Skip to content

Commit e71f90b

Browse files
authored
Merge pull request #1925 from BuckleScript/fix_and_test_missing_primitive
test case for #1923
2 parents 012e74b + 900d851 commit e71f90b

File tree

8 files changed

+84
-1
lines changed

8 files changed

+84
-1
lines changed

jscomp/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,8 @@ install:
633633
./runtime/js_null.ml ./runtime/js_null.cmi \
634634
./runtime/js_undefined.ml ./runtime/js_undefined.cmi \
635635
./runtime/js_exn.ml ./runtime/js_exn.mli ./runtime/js_exn.cmi \
636+
./runtime/js_int.ml ./runtime/js_int.cmi \
637+
./runtime/js_float.ml ./runtime/js_float.cmi \
636638
./runtime/js_typed_array.ml ./runtime/js_typed_array.cmi $(DEST)
637639
cp ./stdlib/*.ml ./stdlib/*.mli $(DEST)
638640
# ./runtime/js_null_undefined.ml ./runtime/js_null_undefined.cmi

jscomp/build_tests/exports/.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
*.exe
2+
*.obj
3+
*.out
4+
*.compile
5+
*.native
6+
*.byte
7+
*.cmo
8+
*.annot
9+
*.cmi
10+
*.cmx
11+
*.cmt
12+
*.cmti
13+
*.cma
14+
*.a
15+
*.cmxa
16+
*.obj
17+
*~
18+
*.annot
19+
*.cmj
20+
*.bak
21+
lib/bs
22+
*.mlast
23+
*.mliast
24+
.vscode
25+
.merlin

jscomp/build_tests/exports/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
# Build
4+
```
5+
npm run build
6+
```
7+
8+
# Watch
9+
10+
```
11+
npm run watch
12+
```
13+
14+
15+
# Editor
16+
If you use `vscode`, Press `Windows + Shift + B` it will build automatically
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "exports",
3+
"version": "0.1.0",
4+
"sources": [
5+
"src"
6+
],
7+
"bs-dependencies" : [
8+
// add your bs-dependencies here
9+
]
10+
}

jscomp/build_tests/exports/input.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
var child_process = require('child_process')
2+
3+
child_process.execSync(`bsb`,
4+
{ cwd: __dirname, encoding: 'utf8', stdio: [0, 1, 2] })
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "exports",
3+
"version": "0.1.0",
4+
"scripts": {
5+
"clean": "bsb -clean-world",
6+
"build": "bsb -make-world",
7+
"watch": "bsb -make-world -w"
8+
},
9+
"keywords": [
10+
"BuckleScript"
11+
],
12+
"license": "MIT",
13+
"devDependencies": {
14+
"bs-platform": "1.8.3"
15+
}
16+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
3+
let _ =
4+
Js.Int.toString,
5+
Js.Float.isNaN

jscomp/js.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ ocamlc.opt -w -30-40 -no-check-prims -I bin bin/config_whole_compiler.mli bin/c
1818
# BS_PLAYGROUND=../../bucklescript-playground
1919
# NEED PRESET env varialbe BS_PLAYGROUND
2020
# node compiler_test.js in bucklescript-playground
21-
js_of_ocaml --toplevel +weak.js ./polyfill.js jsc.byte -I ./stdlib -I ./others/ -I ./runtime/ --file lazy.cmi:/cmis/lazy.cmi --file js.cmi:/cmis/js.cmi --file js_unsafe.cmi:/cmis/js_unsafe.cmi --file js_re.cmi:/cmis/js_re.cmi --file js_array.cmi:/cmis/js_array.cmi --file js_null.cmi:/cmis/js_null.cmi --file js_undefined.cmi:/cmis/js_undefined.cmi --file js_internal.cmi:/cmis/js_internal.cmi --file js_types.cmi:/cmis/js_types.cmi --file js_null_undefined.cmi:/cmis/js_null_undefined.cmi --file js_dict.cmi:/cmis/js_dict.cmi --file js_string.cmi:/cmis/js_string.cmi -o $BS_PLAYGROUND/exports.js
21+
js_of_ocaml --toplevel +weak.js ./polyfill.js jsc.byte -I ./stdlib -I ./others/ -I ./runtime/ \
22+
--file lazy.cmi:/cmis/lazy.cmi --file js.cmi:/cmis/js.cmi --file js_unsafe.cmi:/cmis/js_unsafe.cmi \
23+
--file js_re.cmi:/cmis/js_re.cmi --file js_array.cmi:/cmis/js_array.cmi --file js_null.cmi:/cmis/js_null.cmi \
24+
--file js_undefined.cmi:/cmis/js_undefined.cmi --file js_internal.cmi:/cmis/js_internal.cmi --file js_types.cmi:/cmis/js_types.cmi \
25+
--file js_null_undefined.cmi:/cmis/js_null_undefined.cmi --file js_dict.cmi:/cmis/js_dict.cmi --file js_string.cmi:/cmis/js_string.cmi\
26+
-o $BS_PLAYGROUND/exports.js
2227

2328

2429

0 commit comments

Comments
 (0)