-
-
Notifications
You must be signed in to change notification settings - Fork 669
BREAKING CHANGE: ESM, JS bindings, triple equals and general cleanup #2157
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
Changes from all commits
7dab337
cba554c
2194988
83b659f
14eedb6
ff9e30b
df44d47
7715882
7b89619
a0b5077
10699dd
0fba4d3
1bee659
4492b4a
d048c1e
d3a1274
c6557b0
281ae4d
592f503
4f932b2
4faba35
479aff4
84ccac4
a3d4531
78dbabd
28e7791
9165068
4076286
3f9223d
1b51772
35a1e12
02dc4a1
a4d1958
4bb1814
cdf107f
ce914fc
8c59d2b
15c5044
fae90f8
b57b1d8
41c2bb1
8ef9ce2
0aeafb4
f6a5385
9b5aeb7
f6e70d7
d867b23
c47d4a5
2c4ad81
fa6150b
a5610fa
d3d3096
69cbdbc
d6112aa
790a1c0
90df2b3
193baaa
39951d6
6620f77
2598e71
e4e239e
cd66585
da61ab0
c36dafb
3845795
e09ec02
1db68bd
0a9a1a2
b54aefe
9877cb7
d46bee7
8fa2845
fca4666
cbbd064
0446963
502d1b9
395f4a9
3d071a9
b96f9d3
d039865
b84e976
8b1ae12
75e76f4
0a93d92
25ec2cd
eac6b31
416d734
c2f5f32
eda668e
0492055
5d0b109
272461a
40679b5
1c40822
34b7c55
3c73d15
2b2ae1d
14c25d9
0ba9dcf
850ec4b
046d8e7
4fd9050
43ecbe8
abc1d81
67f4b84
d08c3dd
94c4f37
31702c6
02972f8
5b3f24a
5c383f1
e39d9ae
d46eb68
0eba569
2f1eb73
5706912
3900ef8
090ce5c
096a77c
88b31bf
2b2aee8
7fb896a
6a711e7
34b1212
81ef128
40dceea
8182779
541a1cd
9dfcd7c
15c47ea
c839986
1d3c4be
0ff0820
2b6428f
e17a6ca
9468996
556f0df
df054ba
83e0632
931495d
3a83bb0
23b5f9e
a69cffd
9da0fdd
e2ac2d3
75328a9
1722afa
337c826
47f4eb4
e25ca01
cc1bd11
05913bf
1dadb87
634e414
c6590de
9cc6962
772df6f
0787128
61da567
bc7973e
af1b4fa
2c2ec07
fb6bc87
74f744c
3186d99
07609a7
2033e2d
63ed838
270a01b
bd22829
b1870ce
b17cefb
b163bd5
a223638
b9120d1
cc45b9e
628bd8e
d7a4404
5bfaa99
45f4ee8
4721a2c
70e9b88
ef60e80
ded520a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
dist/ | ||
docs/ | ||
lib/binaryen.js | ||
lib/parse/index.js | ||
out/ | ||
build/ | ||
raw/ | ||
tests/parser/ | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
bin/* text eol=lf | ||
dist/* binary | ||
scripts/*.sh eol=lf | ||
lib/binaryen.js binary | ||
tests/compiler/std/string-encoding.ts eol=lf | ||
src/bindings/js.ts eol=lf | ||
src/bindings/tsd.ts eol=lf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
npm-debug.* | ||
dist/ | ||
docs/ | ||
node_modules/ | ||
out/ | ||
*debug.log | ||
dist/ | ||
build/ | ||
raw/ | ||
.history | ||
*.backup | ||
.vscode | ||
.idea | ||
cli/index.generated.js | ||
src/diagnosticMessages.generated.ts |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env node | ||
|
||
const [ nodePath, thisPath, ...args ] = process.argv; | ||
const nodeArgs = process.execArgv; | ||
|
||
const hasSourceMaps = nodeArgs.includes("--enable-source-maps"); | ||
const posCustomArgs = args.indexOf("--"); | ||
const isDeno = typeof Deno !== "undefined"; | ||
|
||
if (isDeno) { | ||
process.on = function() { /* suppress 'not implemented' message */ }; | ||
} | ||
|
||
if ((!hasSourceMaps || ~posCustomArgs) && !isDeno) { | ||
if (!hasSourceMaps) { | ||
nodeArgs.push("--enable-source-maps"); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why support the option if it is always enabled? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I see, it's not AS-specific, we just always want Node to have it enabled. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, previously was using an npm package for source map support, but recent Node has this option which works better. In particular, when crashing, this produces a proper trace instead of a lot of gibberish. |
||
if (~posCustomArgs) { | ||
nodeArgs.push(...args.slice(posCustomArgs + 1)); | ||
args.length = posCustomArgs; | ||
} | ||
(await import("child_process")).spawnSync( | ||
nodePath, | ||
[...nodeArgs, thisPath, ...args], | ||
{ stdio: "inherit" } | ||
); | ||
} else { | ||
const { error } = (await import("../dist/asc.js")).main(process.argv.slice(2), { | ||
stdout: process.stdout, | ||
stderr: process.stderr | ||
}); | ||
if (error) process.exitCode = 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does
pos
stand for?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, piece of poo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stands for position here. Would you like it to be changed?