Skip to content

Commit 688dcd2

Browse files
authored
Implicitly inherit from Object (#2559)
BREAKING CHANGE: Constant class ids of `String`, `ArrayBuffer` etc. moved one value up, with `Object` now represented by ID=0.
1 parent a71f649 commit 688dcd2

File tree

272 files changed

+18037
-12313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+18037
-12313
lines changed

Diff for: lib/loader/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ const ID_OFFSET = -8;
33
const SIZE_OFFSET = -4;
44

55
// Runtime ids
6-
const ARRAYBUFFER_ID = 0;
7-
const STRING_ID = 1;
8-
// const ARRAYBUFFERVIEW_ID = 2;
6+
// const OBJECT_ID = 0;
7+
const ARRAYBUFFER_ID = 1;
8+
const STRING_ID = 2;
99

1010
// Runtime type information
1111
const ARRAYBUFFERVIEW = 1 << 0;

Diff for: lib/loader/tests/build/default.wasm

32 Bytes
Binary file not shown.

Diff for: lib/loader/tests/build/legacy.wasm

32 Bytes
Binary file not shown.

Diff for: lib/loader/umd/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ var loader = (function(exports) {
1313
// Runtime header offsets
1414
const ID_OFFSET = -8;
1515
const SIZE_OFFSET = -4; // Runtime ids
16+
// const OBJECT_ID = 0;
1617

17-
const ARRAYBUFFER_ID = 0;
18-
const STRING_ID = 1; // const ARRAYBUFFERVIEW_ID = 2;
19-
// Runtime type information
18+
const ARRAYBUFFER_ID = 1;
19+
const STRING_ID = 2; // Runtime type information
2020

2121
const ARRAYBUFFERVIEW = 1 << 0;
2222
const ARRAY = 1 << 1;

Diff for: src/bindings/js.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ function isPlainFunction(signature: Signature, mode: Mode): bool {
13361336

13371337
function isPlainObject(clazz: Class): bool {
13381338
// A plain object does not inherit and does not have a constructor or private properties
1339-
if (clazz.base) return false;
1339+
if (clazz.base && !clazz.prototype.implicitlyExtendsObject) return false;
13401340
let members = clazz.members;
13411341
if (members) {
13421342
for (let _values = Map_values(members), i = 0, k = _values.length; i < k; ++i) {

Diff for: src/bindings/tsd.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export class TSDBuilder extends ExportsWalker {
230230

231231
isPlainObject(clazz: Class): bool {
232232
// A plain object does not inherit and does not have a constructor or private properties
233-
if (clazz.base) return false;
233+
if (clazz.base && !clazz.prototype.implicitlyExtendsObject) return false;
234234
let members = clazz.members;
235235
if (members) {
236236
for (let _values = Map_values(members), i = 0, k = _values.length; i < k; ++i) {

Diff for: src/builtins.ts

+3
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,9 @@ export namespace BuiltinNames {
732732
export const String_eq = "~lib/string/String.__eq";
733733
export const String_ne = "~lib/string/String.__ne";
734734
export const String_not = "~lib/string/String.__not";
735+
736+
// std/object.ts
737+
export const Object = "~lib/object/Object";
735738
}
736739

737740
/** Builtin compilation context. */

Diff for: src/compiler.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ export class Compiler extends DiagnosticEmitter {
17161716
}
17171717

17181718
// check that super has been called if this is a derived class
1719-
if (classInstance.base && !flow.is(FlowFlags.CallsSuper)) {
1719+
if (classInstance.base && !classInstance.prototype.implicitlyExtendsObject && !flow.is(FlowFlags.CallsSuper)) {
17201720
this.error(
17211721
DiagnosticCode.Constructors_for_derived_classes_must_contain_a_super_call,
17221722
instance.prototype.declaration.range
@@ -5950,7 +5950,7 @@ export class Compiler extends DiagnosticEmitter {
59505950
assert(parent.kind == ElementKind.Class);
59515951
let classInstance = <Class>parent;
59525952
let baseClassInstance = classInstance.base;
5953-
if (!baseClassInstance) {
5953+
if (!baseClassInstance || classInstance.prototype.implicitlyExtendsObject) {
59545954
this.error(
59555955
DiagnosticCode._super_can_only_be_referenced_in_a_derived_class,
59565956
expression.expression.range

Diff for: src/program.ts

+23-5
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,14 @@ export class Program extends DiagnosticEmitter {
640640
}
641641
private _regexpInstance: Class | null = null;
642642

643+
/** Gets the standard `Object` prototype. */
644+
get objectPrototype(): ClassPrototype {
645+
let cached = this._objectPrototype;
646+
if (!cached) this._objectPrototype = cached = <ClassPrototype>this.require(CommonNames.Object, ElementKind.ClassPrototype);
647+
return cached;
648+
}
649+
private _objectPrototype: ClassPrototype | null = null;
650+
643651
/** Gets the standard `Object` instance. */
644652
get objectInstance(): Class {
645653
let cached = this._objectInstance;
@@ -1257,10 +1265,11 @@ export class Program extends DiagnosticEmitter {
12571265
}
12581266
}
12591267

1260-
// register ArrayBuffer (id=0), String (id=1), ArrayBufferView (id=2)
1261-
assert(this.arrayBufferInstance.id == 0);
1262-
assert(this.stringInstance.id == 1);
1263-
assert(this.arrayBufferViewInstance.id == 2);
1268+
// register foundational classes with fixed ids
1269+
assert(this.objectInstance.id == 0);
1270+
assert(this.arrayBufferInstance.id == 1);
1271+
assert(this.stringInstance.id == 2);
1272+
assert(this.arrayBufferViewInstance.id == 3);
12641273

12651274
// register classes backing basic types
12661275
this.registerWrapperClass(Type.i8, CommonNames.I8);
@@ -2044,7 +2053,14 @@ export class Program extends DiagnosticEmitter {
20442053
}
20452054

20462055
// remember classes that extend another class
2047-
if (declaration.extendsType) queuedExtends.push(element);
2056+
if (declaration.extendsType) {
2057+
queuedExtends.push(element);
2058+
} else if (
2059+
!element.hasDecorator(DecoratorFlags.Unmanaged) &&
2060+
element.internalName != BuiltinNames.Object
2061+
) {
2062+
element.implicitlyExtendsObject = true;
2063+
}
20482064

20492065
// initialize members
20502066
let memberDeclarations = declaration.members;
@@ -4165,6 +4181,8 @@ export class ClassPrototype extends DeclaredElement {
41654181
instances: Map<string,Class> | null = null;
41664182
/** Classes extending this class. */
41674183
extendees: Set<ClassPrototype> = new Set();
4184+
/** Whether this class implicitly extends `Object`. */
4185+
implicitlyExtendsObject: bool = false;
41684186

41694187
constructor(
41704188
/** Simple name. */

Diff for: src/resolver.ts

+6
Original file line numberDiff line numberDiff line change
@@ -3121,6 +3121,10 @@ export class Resolver extends DiagnosticEmitter {
31213121
// This is guaranteed to never happen at the entry of the recursion, i.e.
31223122
// where `resolveClass` is called from other code.
31233123
if (pendingClasses.has(base)) anyPending = true;
3124+
3125+
// Implicitly extend `Object` if a derived object
3126+
} else if (prototype.implicitlyExtendsObject) {
3127+
instance.setBase(this.program.objectInstance);
31243128
}
31253129

31263130
// Resolve interfaces if applicable
@@ -3298,13 +3302,15 @@ export class Resolver extends DiagnosticEmitter {
32983302
let memoryOffset: u32 = 0;
32993303
let base = instance.base;
33003304
if (base) {
3305+
let implicitlyExtendsObject = instance.prototype.implicitlyExtendsObject;
33013306
assert(!pendingClasses.has(base));
33023307
let baseMembers = base.members;
33033308
if (baseMembers) {
33043309
// TODO: for (let [baseMemberName, baseMember] of baseMembers) {
33053310
for (let _keys = Map_keys(baseMembers), i = 0, k = _keys.length; i < k; ++i) {
33063311
let memberName = unchecked(_keys[i]);
33073312
let baseMember = assert(baseMembers.get(memberName));
3313+
if (implicitlyExtendsObject && baseMember.is(CommonFlags.Static)) continue;
33083314
let existingMember = instance.getMember(memberName);
33093315
if (existingMember && !this.checkOverrideVisibility(memberName, existingMember, instance, baseMember, base, reportMode)) {
33103316
continue; // keep previous

Diff for: std/assembly/object.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export class Object {
1+
export abstract class Object {
22
static is<T>(x: T, y: T): bool {
33
if (isFloat<T>()) {
44
// Float pointing is special we shoulr presere following identities:
@@ -19,4 +19,18 @@ export class Object {
1919
// For references, strings, integers and booleans
2020
return x == y;
2121
}
22+
23+
// TODO: Wrapper classes like `Function<T>` override the `this` type of
24+
// `toString`, which is covariant and hence fails to overload. Wrapper classes
25+
// might need a different mechanism to indicate such special `this` types.
26+
// toString(): string {
27+
// return "[object Object]";
28+
// }
2229
}
30+
31+
// TODO: The types `Object` and `object` differ in TypeScript, in that the
32+
// latter indicates any non-primitive type, not including `string` for example.
33+
// The `object` type hence remains reserved for now, also to potentially address
34+
// the above `toString` TODO in alternative ways.
35+
// @ts-ignore: nolib
36+
// export type object = Object;

Diff for: std/assembly/rt/itcms.ts

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ function initLazy(space: Object): Object {
117117
/** Tests if this object is pointerfree. */
118118
get isPointerfree(): bool {
119119
let rtId = this.rtId;
120+
// 0: Object, 1: ArrayBuffer, 2: String
120121
return rtId <= idof<string>() || (__typeinfo(rtId) & TypeinfoFlags.POINTERFREE) != 0;
121122
}
122123

Diff for: tests/compiler/NonNullable.debug.wat

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 33068))
1616
(global $~lib/memory/__heap_base i32 (i32.const 33068))
1717
(memory $0 1)
18-
(data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00u\003\002\00\00\00\00\00\00\00")
19-
(data (i32.const 44) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00N\00o\00n\00N\00u\00l\00l\00a\00b\00l\00e\00.\00t\00s\00")
20-
(data (i32.const 92) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00S\00t\00r\00i\00n\00g\00")
21-
(data (i32.const 124) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\002\00\00\00A\00r\00r\00a\00y\00<\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00/\00S\00t\00r\00i\00n\00g\00>\00\00\00\00\00\00\00\00\00\00\00")
22-
(data (i32.const 204) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00z\00\00\00\00\00\00\00\00\00\00\00")
23-
(data (i32.const 236) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
18+
(data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\06\00\00\00u\003\002\00\00\00\00\00\00\00")
19+
(data (i32.const 44) ",\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\1c\00\00\00N\00o\00n\00N\00u\00l\00l\00a\00b\00l\00e\00.\00t\00s\00")
20+
(data (i32.const 92) "\1c\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\0c\00\00\00S\00t\00r\00i\00n\00g\00")
21+
(data (i32.const 124) "L\00\00\00\00\00\00\00\00\00\00\00\02\00\00\002\00\00\00A\00r\00r\00a\00y\00<\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00/\00S\00t\00r\00i\00n\00g\00>\00\00\00\00\00\00\00\00\00\00\00")
22+
(data (i32.const 204) "\1c\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\02\00\00\00z\00\00\00\00\00\00\00\00\00\00\00")
23+
(data (i32.const 236) "<\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
2424
(table $0 1 1 funcref)
2525
(elem $0 (i32.const 1))
2626
(export "memory" (memory $0))

Diff for: tests/compiler/NonNullable.release.wat

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 34092))
77
(memory $0 1)
88
(data (i32.const 1036) "\1c")
9-
(data (i32.const 1048) "\01\00\00\00\06\00\00\00u\003\002")
9+
(data (i32.const 1048) "\02\00\00\00\06\00\00\00u\003\002")
1010
(data (i32.const 1068) ",")
11-
(data (i32.const 1080) "\01\00\00\00\1c\00\00\00N\00o\00n\00N\00u\00l\00l\00a\00b\00l\00e\00.\00t\00s")
11+
(data (i32.const 1080) "\02\00\00\00\1c\00\00\00N\00o\00n\00N\00u\00l\00l\00a\00b\00l\00e\00.\00t\00s")
1212
(data (i32.const 1116) "\1c")
13-
(data (i32.const 1128) "\01\00\00\00\0c\00\00\00S\00t\00r\00i\00n\00g")
13+
(data (i32.const 1128) "\02\00\00\00\0c\00\00\00S\00t\00r\00i\00n\00g")
1414
(data (i32.const 1148) "L")
15-
(data (i32.const 1160) "\01\00\00\002\00\00\00A\00r\00r\00a\00y\00<\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00/\00S\00t\00r\00i\00n\00g\00>")
15+
(data (i32.const 1160) "\02\00\00\002\00\00\00A\00r\00r\00a\00y\00<\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00/\00S\00t\00r\00i\00n\00g\00>")
1616
(data (i32.const 1228) "\1c")
17-
(data (i32.const 1240) "\01\00\00\00\02\00\00\00z")
17+
(data (i32.const 1240) "\02\00\00\00\02\00\00\00z")
1818
(data (i32.const 1260) "<")
19-
(data (i32.const 1272) "\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l")
19+
(data (i32.const 1272) "\02\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l")
2020
(export "memory" (memory $0))
2121
(start $~start)
2222
(func $~lib/string/String.__eq (type $i32_i32_=>_i32) (param $0 i32) (param $1 i32) (result i32)

Diff for: tests/compiler/abi.debug.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 32812))
1010
(global $~lib/memory/__heap_base i32 (i32.const 32812))
1111
(memory $0 1)
12-
(data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s\00")
12+
(data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s\00")
1313
(table $0 1 1 funcref)
1414
(elem $0 (i32.const 1))
1515
(export "exported" (func $abi/exported))

Diff for: tests/compiler/abi.release.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
(type $none_=>_i32 (func_subtype (result i32) func))
33
(memory $0 1)
44
(data (i32.const 1036) "\1c")
5-
(data (i32.const 1048) "\01\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s")
5+
(data (i32.const 1048) "\02\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s")
66
(export "exported" (func $abi/exported))
77
(export "exportedExported" (func $abi/exported))
88
(export "exportedInternal" (func $abi/exported))

Diff for: tests/compiler/assert-nonnull.debug.wat

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 33148))
1414
(global $~lib/memory/__heap_base i32 (i32.const 33148))
1515
(memory $0 1)
16-
(data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
17-
(data (i32.const 76) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\"\00\00\00a\00s\00s\00e\00r\00t\00-\00n\00o\00n\00n\00u\00l\00l\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00")
18-
(data (i32.const 140) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00\00\00\00\00\00\00\00\00")
19-
(data (i32.const 204) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00")
20-
(data (i32.const 252) "|\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
16+
(data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
17+
(data (i32.const 76) "<\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\"\00\00\00a\00s\00s\00e\00r\00t\00-\00n\00o\00n\00n\00u\00l\00l\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00")
18+
(data (i32.const 140) "<\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00\00\00\00\00\00\00\00\00")
19+
(data (i32.const 204) ",\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00")
20+
(data (i32.const 252) "|\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
2121
(table $0 1 1 funcref)
2222
(elem $0 (i32.const 1))
2323
(export "memory" (memory $0))

Diff for: tests/compiler/assert-nonnull.release.wat

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 34172))
77
(memory $0 1)
88
(data (i32.const 1036) "<")
9-
(data (i32.const 1048) "\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l")
9+
(data (i32.const 1048) "\02\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l")
1010
(data (i32.const 1100) "<")
11-
(data (i32.const 1112) "\01\00\00\00\"\00\00\00a\00s\00s\00e\00r\00t\00-\00n\00o\00n\00n\00u\00l\00l\00.\00t\00s")
11+
(data (i32.const 1112) "\02\00\00\00\"\00\00\00a\00s\00s\00e\00r\00t\00-\00n\00o\00n\00n\00u\00l\00l\00.\00t\00s")
1212
(data (i32.const 1164) "<")
13-
(data (i32.const 1176) "\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e")
13+
(data (i32.const 1176) "\02\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e")
1414
(data (i32.const 1228) ",")
15-
(data (i32.const 1240) "\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s")
15+
(data (i32.const 1240) "\02\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s")
1616
(data (i32.const 1276) "|")
17-
(data (i32.const 1288) "\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y")
17+
(data (i32.const 1288) "\02\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y")
1818
(table $0 1 1 funcref)
1919
(export "memory" (memory $0))
2020
(export "testVar" (func $export:assert-nonnull/testVar))

Diff for: tests/compiler/bigint-integration.debug.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
(global $~lib/memory/__heap_base i32 (i32.const 32844))
1212
(global $~started (mut i32) (i32.const 0))
1313
(memory $0 1)
14-
(data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00*\00\00\00b\00i\00g\00i\00n\00t\00-\00i\00n\00t\00e\00g\00r\00a\00t\00i\00o\00n\00.\00t\00s\00\00\00")
14+
(data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00*\00\00\00b\00i\00g\00i\00n\00t\00-\00i\00n\00t\00e\00g\00r\00a\00t\00i\00o\00n\00.\00t\00s\00\00\00")
1515
(table $0 1 1 funcref)
1616
(elem $0 (i32.const 1))
1717
(export "internalValue" (global $bigint-integration/internalValue))

Diff for: tests/compiler/bigint-integration.release.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
(global $~started (mut i32) (i32.const 0))
1010
(memory $0 1)
1111
(data (i32.const 1036) "<")
12-
(data (i32.const 1048) "\01\00\00\00*\00\00\00b\00i\00g\00i\00n\00t\00-\00i\00n\00t\00e\00g\00r\00a\00t\00i\00o\00n\00.\00t\00s")
12+
(data (i32.const 1048) "\02\00\00\00*\00\00\00b\00i\00g\00i\00n\00t\00-\00i\00n\00t\00e\00g\00r\00a\00t\00i\00o\00n\00.\00t\00s")
1313
(export "internalValue" (global $bigint-integration/internalValue))
1414
(export "getInternalValue" (func $bigint-integration/getInternalValue))
1515
(export "memory" (memory $0))

Diff for: tests/compiler/bindings/esm.debug.d.ts

+12-10
Original file line numberDiff line numberDiff line change
@@ -124,32 +124,32 @@ export declare function arrayFunction(a: Array<number>, b: Array<number>): Array
124124
* @param b `bindings/esm/PlainObject`
125125
* @returns `bindings/esm/PlainObject`
126126
*/
127-
export declare function objectFunction(a: __Record11<undefined>, b: __Record11<undefined>): __Record11<never>;
127+
export declare function objectFunction(a: __Record12<undefined>, b: __Record12<undefined>): __Record12<never>;
128128
/**
129129
* bindings/esm/newInternref
130130
* @returns `bindings/esm/NonPlainObject`
131131
*/
132-
export declare function newInternref(): __Internref14;
132+
export declare function newInternref(): __Internref15;
133133
/**
134134
* bindings/esm/internrefFunction
135135
* @param a `bindings/esm/NonPlainObject`
136136
* @param b `bindings/esm/NonPlainObject`
137137
* @returns `bindings/esm/NonPlainObject`
138138
*/
139-
export declare function internrefFunction(a: __Internref14, b: __Internref14): __Internref14;
139+
export declare function internrefFunction(a: __Internref15, b: __Internref15): __Internref15;
140140
/**
141141
* bindings/esm/functionFunction
142142
* @param fn `() => void`
143143
* @returns `() => void`
144144
*/
145-
export declare function functionFunction(fn: __Internref3): __Internref3;
145+
export declare function functionFunction(fn: __Internref4): __Internref4;
146146
/** bindings/esm/fn */
147147
export declare const fn: {
148148
/** @type `() => void` */
149-
get value(): __Internref3
149+
get value(): __Internref4
150150
};
151151
/** bindings/esm/PlainObject */
152-
declare interface __Record11<TOmittable> {
152+
declare interface __Record12<TOmittable> {
153153
/** @type `i8` */
154154
a: number | TOmittable;
155155
/** @type `i16` */
@@ -184,10 +184,12 @@ declare interface __Record11<TOmittable> {
184184
p: Array<string> | null | TOmittable;
185185
}
186186
/** bindings/esm/NonPlainObject */
187-
declare class __Internref14 extends Number {
188-
private __nominal14: symbol;
187+
declare class __Internref15 extends Number {
188+
private __nominal15: symbol;
189+
private __nominal0: symbol;
189190
}
190191
/** ~lib/function/Function<%28%29=>void> */
191-
declare class __Internref3 extends Number {
192-
private __nominal3: symbol;
192+
declare class __Internref4 extends Number {
193+
private __nominal4: symbol;
194+
private __nominal0: symbol;
193195
}

0 commit comments

Comments
 (0)