Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: AssemblyScript/assemblyscript
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.27.2
Choose a base ref
...
head repository: AssemblyScript/assemblyscript
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.27.3
Choose a head ref
  • 4 commits
  • 26 files changed
  • 2 contributors

Commits on Apr 14, 2023

  1. Update src/README.md (#2685)

    dcodeIO authored Apr 14, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5e3be1e View commit details

Commits on Apr 22, 2023

  1. Copy the full SHA
    b248254 View commit details

Commits on Apr 23, 2023

  1. Copy the full SHA
    3b2381b View commit details
  2. Copy the full SHA
    688746a View commit details
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ jobs:
- uses: dcodeIO/setup-node-nvm@master
with:
node-mirror: https://nodejs.org/download/v8-canary/
node-version: 19.0.0-v8-canary202209029fc5a9347b
node-version: 21.0.0-v8-canary20230419061e93e884
- name: Install dependencies
run: npm ci --no-audit
- name: Build
4 changes: 2 additions & 2 deletions cli/index.js
Original file line number Diff line number Diff line change
@@ -372,7 +372,7 @@ export async function main(argv, options) {
let name = features[i].trim();
let flag = assemblyscript[`FEATURE_${toUpperSnakeCase(name)}`];
if (!flag) return prepareResult(Error(`Feature '${name}' is unknown.`));
assemblyscript.disableFeature(compilerOptions, flag);
assemblyscript.setFeature(compilerOptions, flag, false);
}
}

@@ -383,7 +383,7 @@ export async function main(argv, options) {
let name = features[i].trim();
let flag = assemblyscript[`FEATURE_${toUpperSnakeCase(name)}`];
if (!flag) return prepareResult(Error(`Feature '${name}' is unknown.`));
assemblyscript.enableFeature(compilerOptions, flag);
assemblyscript.setFeature(compilerOptions, flag, true);
}
}

4 changes: 2 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -46,11 +46,11 @@ Uses the AssemblyScript compiler compiled to JavaScript to compile itself to Web
Running `asc` with the WebAssembly variant:

```ts
asc [options...] --wasm build/assemblyscript.release-bootstrap.wasm
asc [options...] --wasm build/assemblyscript.release-bootstrap.js
```

Running the compiler tests with the WebAssembly variant:

```ts
npm run test:compiler -- --wasm build/assemblyscript.release-bootstrap.wasm
npm run test:compiler -- --wasm build/assemblyscript.release-bootstrap.js
```
2 changes: 1 addition & 1 deletion src/bindings/js.ts
Original file line number Diff line number Diff line change
@@ -300,7 +300,7 @@ export class JSBuilder extends ExportsWalker {
sb.push(escapeString(name, CharCode.DoubleQuote));
sb.push("\"");
}
if (isPlainFunction(signature, Mode.Import) && !code) {
if (isPlainFunction(signature, Mode.Import) && !code && isIdentifier(name)) {
sb.push(": (\n");
indent(sb, this.indentLevel + 1);
sb.push("// ");
36 changes: 18 additions & 18 deletions src/builtins.ts
Original file line number Diff line number Diff line change
@@ -3523,7 +3523,7 @@ function builtin_i31_new(ctx: BuiltinFunctionContext): ExpressionRef {
) return module.unreachable();
let operands = ctx.operands;
let arg0 = compiler.compileExpression(operands[0], Type.i32, Constraints.ConvImplicit);
compiler.currentType = Type.i31ref;
compiler.currentType = Type.i31;
return module.i31_new(arg0);
}
builtinFunctions.set(BuiltinNames.i31_new, builtin_i31_new);
@@ -3536,7 +3536,7 @@ function builtin_i31_get(ctx: BuiltinFunctionContext): ExpressionRef {
checkArgsRequired(ctx, 1)
) return module.unreachable();
let operands = ctx.operands;
let arg0 = compiler.compileExpression(operands[0], Type.i31ref, Constraints.ConvImplicit);
let arg0 = compiler.compileExpression(operands[0], Type.i31.asNullable(), Constraints.ConvImplicit);
if (ctx.contextualType.is(TypeFlags.Unsigned)) {
compiler.currentType = Type.u32;
return module.i31_get(arg0, false);
@@ -3653,14 +3653,14 @@ function builtin_assert(ctx: BuiltinFunctionContext): ExpressionRef {
// TODO: also check for NaN in float assertions, as in `Boolean(NaN) -> false`?
case TypeKind.F32: return module.if(module.binary(BinaryOp.EqF32, arg0, module.f32(0)), abort);
case TypeKind.F64: return module.if(module.binary(BinaryOp.EqF64, arg0, module.f64(0)), abort);
case TypeKind.Funcref:
case TypeKind.Externref:
case TypeKind.Anyref:
case TypeKind.Eqref:
case TypeKind.Structref:
case TypeKind.Arrayref:
case TypeKind.I31ref:
case TypeKind.Stringref:
case TypeKind.Func:
case TypeKind.Extern:
case TypeKind.Any:
case TypeKind.Eq:
case TypeKind.Struct:
case TypeKind.Array:
case TypeKind.I31:
case TypeKind.String:
case TypeKind.StringviewWTF8:
case TypeKind.StringviewWTF16:
case TypeKind.StringviewIter: return module.if(module.ref_is_null(arg0), abort);
@@ -3734,14 +3734,14 @@ function builtin_assert(ctx: BuiltinFunctionContext): ExpressionRef {
);
return ret;
}
case TypeKind.Funcref:
case TypeKind.Externref:
case TypeKind.Anyref:
case TypeKind.Eqref:
case TypeKind.Structref:
case TypeKind.Arrayref:
case TypeKind.I31ref:
case TypeKind.Stringref:
case TypeKind.Func:
case TypeKind.Extern:
case TypeKind.Any:
case TypeKind.Eq:
case TypeKind.Struct:
case TypeKind.Array:
case TypeKind.I31:
case TypeKind.String:
case TypeKind.StringviewWTF8:
case TypeKind.StringviewWTF16:
case TypeKind.StringviewIter: {
41 changes: 22 additions & 19 deletions src/common.ts
Original file line number Diff line number Diff line change
@@ -81,7 +81,9 @@ export const enum CommonFlags {
// Other

/** Is quoted. */
Quoted = 1 << 30
Quoted = 1 << 30,
/** Is internally nullable. */
InternallyNullable = 1 << 31
}

/** Path delimiter inserted between file system levels. */
@@ -126,17 +128,17 @@ export namespace CommonNames {
export const f32 = "f32";
export const f64 = "f64";
export const v128 = "v128";
export const funcref = "funcref";
export const externref = "externref";
export const anyref = "anyref";
export const eqref = "eqref";
export const structref = "structref";
export const arrayref = "arrayref";
export const i31ref = "i31ref";
export const stringref = "stringref";
export const stringview_wtf8 = "stringview_wtf8";
export const stringview_wtf16 = "stringview_wtf16";
export const stringview_iter = "stringview_iter";
export const ref_func = "ref_func";
export const ref_extern = "ref_extern";
export const ref_any = "ref_any";
export const ref_eq = "ref_eq";
export const ref_struct = "ref_struct";
export const ref_array = "ref_array";
export const ref_i31 = "ref_i31";
export const ref_string = "ref_string";
export const ref_stringview_wtf8 = "ref_stringview_wtf8";
export const ref_stringview_wtf16 = "ref_stringview_wtf16";
export const ref_stringview_iter = "ref_stringview_iter";
export const i8x16 = "i8x16";
export const u8x16 = "u8x16";
export const i16x8 = "i16x8";
@@ -207,13 +209,14 @@ export namespace CommonNames {
export const F32 = "F32";
export const F64 = "F64";
export const V128 = "V128";
export const Funcref = "Funcref";
export const Externref = "Externref";
export const Anyref = "Anyref";
export const Eqref = "Eqref";
export const Structref = "Structref";
export const Arrayref = "Arrayref";
export const I31ref = "I31ref";
export const RefFunc = "RefFunc";
export const RefExtern = "RefExtern";
export const RefAny = "RefAny";
export const RefEq = "RefEq";
export const RefStruct = "RefStruct";
export const RefArray = "RefArray";
export const RefI31 = "RefI31";
export const RefString = "RefString";
export const String = "String";
export const RegExp = "RegExp";
export const Object = "Object";
Loading