New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Array.isArray and Array#copyWithin #331

Merged
merged 8 commits into from Nov 12, 2018

Conversation

2 participants
@MaxGraey
Copy link
Member

MaxGraey commented Nov 10, 2018

No description provided.

MaxGraey added some commits Nov 10, 2018

@MaxGraey MaxGraey changed the title [WIP] Implement Array.isArray and Array#copyWithin Implement Array.isArray and Array#copyWithin Nov 10, 2018

@MaxGraey MaxGraey requested a review from dcodeIO Nov 10, 2018

MaxGraey added some commits Nov 10, 2018

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.

@dcodeIO

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.

@MaxGraey

MaxGraey Nov 11, 2018

Author Member

Done!

@@ -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.

@dcodeIO

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.

@MaxGraey

MaxGraey Nov 11, 2018

Author Member

Done!

@dcodeIO dcodeIO merged commit 1882679 into AssemblyScript:master Nov 12, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@dcodeIO

This comment has been minimized.

Copy link
Member

dcodeIO commented Nov 12, 2018

Great, thanks! :)

@MaxGraey 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