Skip to content

Commit d80efb0

Browse files
committed
allow more names that isn't related to CommonJS
1 parent 61c8d95 commit d80efb0

11 files changed

+108
-127
lines changed

jscomp/ext/js_reserved_map.ml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ let sorted_js_globals = [|
139139
"BigInt64Array";
140140
"BigUint64Array";
141141
"Boolean";
142-
"Buffer";
143142
"Bun";
144143
"DataView";
145144
"Date";
@@ -188,28 +187,19 @@ let sorted_js_globals = [|
188187
"WeakSet";
189188
"__dirname";
190189
"__filename";
191-
"clearImmediate";
192-
"clearInterval";
193-
"clearTimeout";
194-
"console";
195190
"decodeURI";
196191
"decodeURIComponent";
197192
"encodeURI";
198193
"encodeURIComponent";
199194
"eval";
200195
"exports";
201-
"global";
202196
"globalThis";
203197
"isFinite";
204198
"isNaN";
205199
"module";
206200
"parseFloat";
207201
"parseInt";
208-
"process";
209202
"require";
210-
"setImmediate";
211-
"setInterval";
212-
"setTimeout";
213203
"undefined";
214204
|]
215205

jscomp/test/buffer_test.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/test/global_mangles.js

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/test/key_word_property_plus_test.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/test/mario_game.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/test/sexpm.js

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/es6/arg.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as Caml from "./caml.js";
55
import * as List from "./list.js";
66
import * as $$Array from "./array.js";
77
import * as Curry from "./curry.js";
8-
import * as $$Buffer from "./buffer.js";
8+
import * as Buffer from "./buffer.js";
99
import * as $$String from "./string.js";
1010
import * as Caml_obj from "./caml_obj.js";
1111
import * as Caml_array from "./caml_array.js";
@@ -126,7 +126,7 @@ function add_help(speclist) {
126126
}
127127

128128
function usage_b(buf, speclist, errmsg) {
129-
$$Buffer.add_string(buf, errmsg + "\n");
129+
Buffer.add_string(buf, errmsg + "\n");
130130
List.iter((function (param) {
131131
let doc = param[2];
132132
if (doc.length === 0) {
@@ -135,17 +135,17 @@ function usage_b(buf, speclist, errmsg) {
135135
let spec = param[1];
136136
let key = param[0];
137137
if (spec.TAG !== "Symbol") {
138-
return $$Buffer.add_string(buf, " " + key + " " + doc + "\n");
138+
return Buffer.add_string(buf, " " + key + " " + doc + "\n");
139139
}
140140
let sym = make_symlist("{", "|", "}", spec._0);
141-
return $$Buffer.add_string(buf, " " + key + " " + sym + doc + "\n");
141+
return Buffer.add_string(buf, " " + key + " " + sym + doc + "\n");
142142
}), add_help(speclist));
143143
}
144144

145145
function usage_string(speclist, errmsg) {
146-
let b = $$Buffer.create(200);
146+
let b = Buffer.create(200);
147147
usage_b(b, speclist, errmsg);
148-
return $$Buffer.contents(b);
148+
return Buffer.contents(b);
149149
}
150150

151151
function usage(speclist, errmsg) {
@@ -204,7 +204,7 @@ function float_of_string_opt(x) {
204204
function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist, anonfun, errmsg) {
205205
let initpos = current.contents;
206206
let convert_error = function (error) {
207-
let b = $$Buffer.create(200);
207+
let b = Buffer.create(200);
208208
let progname = initpos < argv.contents.length ? Caml_array.get(argv.contents, initpos) : "(?)";
209209
switch (error.TAG) {
210210
case "Unknown" :
@@ -214,17 +214,17 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist
214214
case "-help" :
215215
break;
216216
default:
217-
$$Buffer.add_string(b, progname + ": unknown option '" + s + "'.\n");
217+
Buffer.add_string(b, progname + ": unknown option '" + s + "'.\n");
218218
}
219219
break;
220220
case "Wrong" :
221-
$$Buffer.add_string(b, progname + ": wrong argument '" + error._1 + "'; option '" + error._0 + "' expects " + error._2 + ".\n");
221+
Buffer.add_string(b, progname + ": wrong argument '" + error._1 + "'; option '" + error._0 + "' expects " + error._2 + ".\n");
222222
break;
223223
case "Missing" :
224-
$$Buffer.add_string(b, progname + ": option '" + error._0 + "' needs an argument.\n");
224+
Buffer.add_string(b, progname + ": option '" + error._0 + "' needs an argument.\n");
225225
break;
226226
case "Message" :
227-
$$Buffer.add_string(b, progname + ": " + error._0 + ".\n");
227+
Buffer.add_string(b, progname + ": " + error._0 + ".\n");
228228
break;
229229

230230
}
@@ -238,12 +238,12 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist
238238
})) {
239239
return {
240240
RE_EXN_ID: Help,
241-
_1: $$Buffer.contents(b)
241+
_1: Buffer.contents(b)
242242
};
243243
} else {
244244
return {
245245
RE_EXN_ID: Bad,
246-
_1: $$Buffer.contents(b)
246+
_1: Buffer.contents(b)
247247
};
248248
}
249249
};

0 commit comments

Comments
 (0)