Skip to content

Commit f9bb33f

Browse files
authored
Rename __start to _start (#994)
1 parent 7c5e50e commit f9bb33f

27 files changed

+28
-28
lines changed

lib/loader/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ API
3030

3131
Besides demangling classes exported from your entry file to a handy object structure one can use like JS objects, instances are automatically populated with useful utility:
3232

33-
* **__start**(): `void`<br />
33+
* **_start**(): `void`<br />
3434
Explicit start function if the `--explicitStart` option is used. Must be called before any other exports if present.
3535

3636
* **__allocString**(str: `string`): `number`<br />

lib/loader/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface ASUtil {
1616
table?: WebAssembly.Table;
1717

1818
/** Explicit start function, if requested. */
19-
__start(): void;
19+
_start(): void;
2020
/** Allocates a new string in the module's memory and returns a reference (pointer) to it. */
2121
__allocString(str: string): number;
2222
/** Reads (copies) the value of a string from the module's memory. */

src/compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ export class Compiler extends DiagnosticEmitter {
404404
);
405405
startFunctionInstance.finalize(module, funcRef);
406406
if (!explicitStart) module.setStart(funcRef);
407-
else module.addFunctionExport(startFunctionInstance.internalName, "__start");
407+
else module.addFunctionExport(startFunctionInstance.internalName, "_start");
408408
}
409409

410410
// compile runtime features

tests/compiler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,9 @@ function testInstantiate(basename, binaryBuffer, name, glue) {
324324
}
325325
var instance = new WebAssembly.Instance(new WebAssembly.Module(binaryBuffer), imports);
326326
Object.setPrototypeOf(exports, instance.exports);
327-
if (exports.__start) {
327+
if (exports._start) {
328328
console.log(colorsUtil.white(" [start]"));
329-
exports.__start();
329+
exports._start();
330330
}
331331
if (glue.postInstantiate) {
332332
console.log(colorsUtil.white(" [postInstantiate]"));

tests/compiler/features/js-bigint-integration.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
(data (i32.const 16) "B\00\00\00\01\00\00\00\01\00\00\00B\00\00\00f\00e\00a\00t\00u\00r\00e\00s\00/\00j\00s\00-\00b\00i\00g\00i\00n\00t\00-\00i\00n\00t\00e\00g\00r\00a\00t\00i\00o\00n\00.\00t\00s")
1010
(global $features/js-bigint-integration/internalValue i64 (i64.const 9007199254740991))
1111
(global $~lib/started (mut i32) (i32.const 0))
12-
(export "__start" (func $start))
12+
(export "_start" (func $start))
1313
(export "memory" (memory $0))
1414
(export "internalValue" (global $features/js-bigint-integration/internalValue))
1515
(export "getInternalValue" (func $features/js-bigint-integration/getInternalValue))

tests/compiler/features/js-bigint-integration.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
(table $0 1 funcref)
1111
(global $features/js-bigint-integration/internalValue i64 (i64.const 9007199254740991))
1212
(global $~lib/started (mut i32) (i32.const 0))
13-
(export "__start" (func $start))
13+
(export "_start" (func $start))
1414
(export "memory" (memory $0))
1515
(export "internalValue" (global $features/js-bigint-integration/internalValue))
1616
(export "getInternalValue" (func $features/js-bigint-integration/getInternalValue))

tests/compiler/features/mutable-globals.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
(data (i32.const 16) "6\00\00\00\01\00\00\00\01\00\00\006\00\00\00f\00e\00a\00t\00u\00r\00e\00s\00/\00m\00u\00t\00a\00b\00l\00e\00-\00g\00l\00o\00b\00a\00l\00s\00.\00t\00s")
88
(global $features/mutable-globals/internal (mut i32) (i32.const 124))
99
(global $~lib/started (mut i32) (i32.const 0))
10-
(export "__start" (func $start))
10+
(export "_start" (func $start))
1111
(export "memory" (memory $0))
1212
(export "external" (global $features/mutable-globals/external))
1313
(export "internal" (global $features/mutable-globals/internal))

tests/compiler/features/mutable-globals.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
(table $0 1 funcref)
99
(global $features/mutable-globals/internal (mut i32) (i32.const 124))
1010
(global $~lib/started (mut i32) (i32.const 0))
11-
(export "__start" (func $start))
11+
(export "_start" (func $start))
1212
(export "memory" (memory $0))
1313
(export "external" (global $features/mutable-globals/external))
1414
(export "internal" (global $features/mutable-globals/internal))

tests/compiler/retain-release.optimized.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
(global $retain-release/TARGET (mut i32) (i32.const 0))
1818
(global $~lib/argc (mut i32) (i32.const 0))
1919
(global $~lib/started (mut i32) (i32.const 0))
20-
(export "__start" (func $start))
20+
(export "_start" (func $start))
2121
(export "memory" (memory $0))
2222
(export "returnRef" (func $retain-release/returnRef))
2323
(export "receiveRef" (func $retain-release/receiveRef))

tests/compiler/retain-release.untouched.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
(global $~lib/argc (mut i32) (i32.const 0))
1919
(global $~lib/started (mut i32) (i32.const 0))
2020
(global $~lib/heap/__heap_base i32 (i32.const 100))
21-
(export "__start" (func $start))
21+
(export "_start" (func $start))
2222
(export "memory" (memory $0))
2323
(export "returnRef" (func $retain-release/returnRef))
2424
(export "receiveRef" (func $retain-release/receiveRef))

0 commit comments

Comments
 (0)