Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement Array.isArray and Array#copyWithin #331
Conversation
MaxGraey
added some commits
Nov 10, 2018
MaxGraey
changed the title
[WIP] Implement Array.isArray and Array#copyWithin
Implement Array.isArray and Array#copyWithin
Nov 10, 2018
MaxGraey
requested a review
from
dcodeIO
Nov 10, 2018
MaxGraey
added some commits
Nov 10, 2018
dcodeIO
reviewed
Nov 11, 2018
std/assembly/array.ts
Outdated
| export class Array<T> { | ||
|
|
||
| /* @internal */ buffer_: ArrayBuffer; | ||
| /* @internal */ length_: i32; | ||
|
|
||
| @inline static isArray<U>(value: U): bool { | ||
| return isArray(value) && value !== null; |
This comment has been minimized.
This comment has been minimized.
dcodeIO
Nov 11, 2018
Member
In JS, this'd recurse into the static isArray itself I think. It doesn't do that in AS because it resolves these things differently, but might make sense to import isArray as builtin_isArray or something to avoid confusion.
This comment has been minimized.
This comment has been minimized.
dcodeIO
reviewed
Nov 11, 2018
std/assembly/array.ts
Outdated
| @@ -27,11 +27,20 @@ import { | |||
| MAX_DOUBLE_LENGTH | |||
| } from "./internal/number"; | |||
|
|
|||
| @inline | |||
| function mix<T extends number>(a: T, b: T): T { | |||
This comment has been minimized.
This comment has been minimized.
dcodeIO
Nov 11, 2018
Member
To me, it's not quite obvious what this is doing just from its name. Would favor to not use a helper here.
This comment has been minimized.
This comment has been minimized.
dcodeIO
merged commit 1882679
into
AssemblyScript:master
Nov 12, 2018
1 check passed
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
This comment has been minimized.
This comment has been minimized.
|
Great, thanks! :) |
MaxGraey
deleted the
MaxGraey:add-more-array-methods
branch
Nov 12, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.


MaxGraey commentedNov 10, 2018
No description provided.