Skip to content

Implicitly inherit from Object #2559

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

Merged
merged 7 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/loader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const ID_OFFSET = -8;
const SIZE_OFFSET = -4;

// Runtime ids
const ARRAYBUFFER_ID = 0;
const STRING_ID = 1;
// const ARRAYBUFFERVIEW_ID = 2;
// const OBJECT_ID = 0;
const ARRAYBUFFER_ID = 1;
const STRING_ID = 2;

// Runtime type information
const ARRAYBUFFERVIEW = 1 << 0;
Expand Down
Binary file modified lib/loader/tests/build/default.wasm
Binary file not shown.
Binary file modified lib/loader/tests/build/legacy.wasm
Binary file not shown.
6 changes: 3 additions & 3 deletions lib/loader/umd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ var loader = (function(exports) {
// Runtime header offsets
const ID_OFFSET = -8;
const SIZE_OFFSET = -4; // Runtime ids
// const OBJECT_ID = 0;

const ARRAYBUFFER_ID = 0;
const STRING_ID = 1; // const ARRAYBUFFERVIEW_ID = 2;
// Runtime type information
const ARRAYBUFFER_ID = 1;
const STRING_ID = 2; // Runtime type information

const ARRAYBUFFERVIEW = 1 << 0;
const ARRAY = 1 << 1;
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ function isPlainFunction(signature: Signature, mode: Mode): bool {

function isPlainObject(clazz: Class): bool {
// A plain object does not inherit and does not have a constructor or private properties
if (clazz.base) return false;
if (clazz.base && !clazz.prototype.implicitlyExtendsObject) return false;
let members = clazz.members;
if (members) {
for (let _values = Map_values(members), i = 0, k = _values.length; i < k; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/tsd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export class TSDBuilder extends ExportsWalker {

isPlainObject(clazz: Class): bool {
// A plain object does not inherit and does not have a constructor or private properties
if (clazz.base) return false;
if (clazz.base && !clazz.prototype.implicitlyExtendsObject) return false;
let members = clazz.members;
if (members) {
for (let _values = Map_values(members), i = 0, k = _values.length; i < k; ++i) {
Expand Down
3 changes: 3 additions & 0 deletions src/builtins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,9 @@ export namespace BuiltinNames {
export const String_eq = "~lib/string/String.__eq";
export const String_ne = "~lib/string/String.__ne";
export const String_not = "~lib/string/String.__not";

// std/object.ts
export const Object = "~lib/object/Object";
}

/** Builtin compilation context. */
Expand Down
4 changes: 2 additions & 2 deletions src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@ export class Compiler extends DiagnosticEmitter {
}

// check that super has been called if this is a derived class
if (classInstance.base && !flow.is(FlowFlags.CallsSuper)) {
if (classInstance.base && !classInstance.prototype.implicitlyExtendsObject && !flow.is(FlowFlags.CallsSuper)) {
this.error(
DiagnosticCode.Constructors_for_derived_classes_must_contain_a_super_call,
instance.prototype.declaration.range
Expand Down Expand Up @@ -5950,7 +5950,7 @@ export class Compiler extends DiagnosticEmitter {
assert(parent.kind == ElementKind.Class);
let classInstance = <Class>parent;
let baseClassInstance = classInstance.base;
if (!baseClassInstance) {
if (!baseClassInstance || classInstance.prototype.implicitlyExtendsObject) {
this.error(
DiagnosticCode._super_can_only_be_referenced_in_a_derived_class,
expression.expression.range
Expand Down
28 changes: 23 additions & 5 deletions src/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,14 @@ export class Program extends DiagnosticEmitter {
}
private _regexpInstance: Class | null = null;

/** Gets the standard `Object` prototype. */
get objectPrototype(): ClassPrototype {
let cached = this._objectPrototype;
if (!cached) this._objectPrototype = cached = <ClassPrototype>this.require(CommonNames.Object, ElementKind.ClassPrototype);
return cached;
}
private _objectPrototype: ClassPrototype | null = null;

/** Gets the standard `Object` instance. */
get objectInstance(): Class {
let cached = this._objectInstance;
Expand Down Expand Up @@ -1257,10 +1265,11 @@ export class Program extends DiagnosticEmitter {
}
}

// register ArrayBuffer (id=0), String (id=1), ArrayBufferView (id=2)
assert(this.arrayBufferInstance.id == 0);
assert(this.stringInstance.id == 1);
assert(this.arrayBufferViewInstance.id == 2);
// register foundational classes with fixed ids
assert(this.objectInstance.id == 0);
assert(this.arrayBufferInstance.id == 1);
assert(this.stringInstance.id == 2);
assert(this.arrayBufferViewInstance.id == 3);

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

// remember classes that extend another class
if (declaration.extendsType) queuedExtends.push(element);
if (declaration.extendsType) {
queuedExtends.push(element);
} else if (
!element.hasDecorator(DecoratorFlags.Unmanaged) &&
element.internalName != BuiltinNames.Object
) {
element.implicitlyExtendsObject = true;
}

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

constructor(
/** Simple name. */
Expand Down
6 changes: 6 additions & 0 deletions src/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3121,6 +3121,10 @@ export class Resolver extends DiagnosticEmitter {
// This is guaranteed to never happen at the entry of the recursion, i.e.
// where `resolveClass` is called from other code.
if (pendingClasses.has(base)) anyPending = true;

// Implicitly extend `Object` if a derived object
} else if (prototype.implicitlyExtendsObject) {
instance.setBase(this.program.objectInstance);
}

// Resolve interfaces if applicable
Expand Down Expand Up @@ -3298,13 +3302,15 @@ export class Resolver extends DiagnosticEmitter {
let memoryOffset: u32 = 0;
let base = instance.base;
if (base) {
let implicitlyExtendsObject = instance.prototype.implicitlyExtendsObject;
assert(!pendingClasses.has(base));
let baseMembers = base.members;
if (baseMembers) {
// TODO: for (let [baseMemberName, baseMember] of baseMembers) {
for (let _keys = Map_keys(baseMembers), i = 0, k = _keys.length; i < k; ++i) {
let memberName = unchecked(_keys[i]);
let baseMember = assert(baseMembers.get(memberName));
if (implicitlyExtendsObject && baseMember.is(CommonFlags.Static)) continue;
let existingMember = instance.getMember(memberName);
if (existingMember && !this.checkOverrideVisibility(memberName, existingMember, instance, baseMember, base, reportMode)) {
continue; // keep previous
Expand Down
16 changes: 15 additions & 1 deletion std/assembly/object.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export class Object {
export abstract class Object {
static is<T>(x: T, y: T): bool {
if (isFloat<T>()) {
// Float pointing is special we shoulr presere following identities:
Expand All @@ -19,4 +19,18 @@ export class Object {
// For references, strings, integers and booleans
return x == y;
}

// TODO: Wrapper classes like `Function<T>` override the `this` type of
// `toString`, which is covariant and hence fails to overload. Wrapper classes
// might need a different mechanism to indicate such special `this` types.
// toString(): string {
// return "[object Object]";
// }
}

// TODO: The types `Object` and `object` differ in TypeScript, in that the
// latter indicates any non-primitive type, not including `string` for example.
// The `object` type hence remains reserved for now, also to potentially address
// the above `toString` TODO in alternative ways.
// @ts-ignore: nolib
// export type object = Object;
1 change: 1 addition & 0 deletions std/assembly/rt/itcms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ function initLazy(space: Object): Object {
/** Tests if this object is pointerfree. */
get isPointerfree(): bool {
let rtId = this.rtId;
// 0: Object, 1: ArrayBuffer, 2: String
return rtId <= idof<string>() || (__typeinfo(rtId) & TypeinfoFlags.POINTERFREE) != 0;
}

Expand Down
12 changes: 6 additions & 6 deletions tests/compiler/NonNullable.debug.wat
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 33068))
(global $~lib/memory/__heap_base i32 (i32.const 33068))
(memory $0 1)
(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")
(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")
(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")
(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")
(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")
(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")
(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")
(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")
(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")
(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")
(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")
(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")
(table $0 1 1 funcref)
(elem $0 (i32.const 1))
(export "memory" (memory $0))
Expand Down
12 changes: 6 additions & 6 deletions tests/compiler/NonNullable.release.wat
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 34092))
(memory $0 1)
(data (i32.const 1036) "\1c")
(data (i32.const 1048) "\01\00\00\00\06\00\00\00u\003\002")
(data (i32.const 1048) "\02\00\00\00\06\00\00\00u\003\002")
(data (i32.const 1068) ",")
(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")
(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")
(data (i32.const 1116) "\1c")
(data (i32.const 1128) "\01\00\00\00\0c\00\00\00S\00t\00r\00i\00n\00g")
(data (i32.const 1128) "\02\00\00\00\0c\00\00\00S\00t\00r\00i\00n\00g")
(data (i32.const 1148) "L")
(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>")
(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>")
(data (i32.const 1228) "\1c")
(data (i32.const 1240) "\01\00\00\00\02\00\00\00z")
(data (i32.const 1240) "\02\00\00\00\02\00\00\00z")
(data (i32.const 1260) "<")
(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")
(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")
(export "memory" (memory $0))
(start $~start)
(func $~lib/string/String.__eq (type $i32_i32_=>_i32) (param $0 i32) (param $1 i32) (result i32)
Expand Down
2 changes: 1 addition & 1 deletion tests/compiler/abi.debug.wat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 32812))
(global $~lib/memory/__heap_base i32 (i32.const 32812))
(memory $0 1)
(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")
(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")
(table $0 1 1 funcref)
(elem $0 (i32.const 1))
(export "exported" (func $abi/exported))
Expand Down
2 changes: 1 addition & 1 deletion tests/compiler/abi.release.wat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(type $none_=>_i32 (func_subtype (result i32) func))
(memory $0 1)
(data (i32.const 1036) "\1c")
(data (i32.const 1048) "\01\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s")
(data (i32.const 1048) "\02\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s")
(export "exported" (func $abi/exported))
(export "exportedExported" (func $abi/exported))
(export "exportedInternal" (func $abi/exported))
Expand Down
10 changes: 5 additions & 5 deletions tests/compiler/assert-nonnull.debug.wat
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 33148))
(global $~lib/memory/__heap_base i32 (i32.const 33148))
(memory $0 1)
(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")
(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")
(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")
(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")
(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")
(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")
(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")
(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")
(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")
(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")
(table $0 1 1 funcref)
(elem $0 (i32.const 1))
(export "memory" (memory $0))
Expand Down
10 changes: 5 additions & 5 deletions tests/compiler/assert-nonnull.release.wat
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 34172))
(memory $0 1)
(data (i32.const 1036) "<")
(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")
(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")
(data (i32.const 1100) "<")
(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")
(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")
(data (i32.const 1164) "<")
(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")
(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")
(data (i32.const 1228) ",")
(data (i32.const 1240) "\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s")
(data (i32.const 1240) "\02\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s")
(data (i32.const 1276) "|")
(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")
(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")
(table $0 1 1 funcref)
(export "memory" (memory $0))
(export "testVar" (func $export:assert-nonnull/testVar))
Expand Down
2 changes: 1 addition & 1 deletion tests/compiler/bigint-integration.debug.wat
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
(global $~lib/memory/__heap_base i32 (i32.const 32844))
(global $~started (mut i32) (i32.const 0))
(memory $0 1)
(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")
(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")
(table $0 1 1 funcref)
(elem $0 (i32.const 1))
(export "internalValue" (global $bigint-integration/internalValue))
Expand Down
2 changes: 1 addition & 1 deletion tests/compiler/bigint-integration.release.wat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
(global $~started (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 1036) "<")
(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")
(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")
(export "internalValue" (global $bigint-integration/internalValue))
(export "getInternalValue" (func $bigint-integration/getInternalValue))
(export "memory" (memory $0))
Expand Down
22 changes: 12 additions & 10 deletions tests/compiler/bindings/esm.debug.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,32 +124,32 @@ export declare function arrayFunction(a: Array<number>, b: Array<number>): Array
* @param b `bindings/esm/PlainObject`
* @returns `bindings/esm/PlainObject`
*/
export declare function objectFunction(a: __Record11<undefined>, b: __Record11<undefined>): __Record11<never>;
export declare function objectFunction(a: __Record12<undefined>, b: __Record12<undefined>): __Record12<never>;
/**
* bindings/esm/newInternref
* @returns `bindings/esm/NonPlainObject`
*/
export declare function newInternref(): __Internref14;
export declare function newInternref(): __Internref15;
/**
* bindings/esm/internrefFunction
* @param a `bindings/esm/NonPlainObject`
* @param b `bindings/esm/NonPlainObject`
* @returns `bindings/esm/NonPlainObject`
*/
export declare function internrefFunction(a: __Internref14, b: __Internref14): __Internref14;
export declare function internrefFunction(a: __Internref15, b: __Internref15): __Internref15;
/**
* bindings/esm/functionFunction
* @param fn `() => void`
* @returns `() => void`
*/
export declare function functionFunction(fn: __Internref3): __Internref3;
export declare function functionFunction(fn: __Internref4): __Internref4;
/** bindings/esm/fn */
export declare const fn: {
/** @type `() => void` */
get value(): __Internref3
get value(): __Internref4
};
/** bindings/esm/PlainObject */
declare interface __Record11<TOmittable> {
declare interface __Record12<TOmittable> {
/** @type `i8` */
a: number | TOmittable;
/** @type `i16` */
Expand Down Expand Up @@ -184,10 +184,12 @@ declare interface __Record11<TOmittable> {
p: Array<string> | null | TOmittable;
}
/** bindings/esm/NonPlainObject */
declare class __Internref14 extends Number {
private __nominal14: symbol;
declare class __Internref15 extends Number {
private __nominal15: symbol;
private __nominal0: symbol;
}
/** ~lib/function/Function<%28%29=>void> */
declare class __Internref3 extends Number {
private __nominal3: symbol;
declare class __Internref4 extends Number {
private __nominal4: symbol;
private __nominal0: symbol;
}
Loading