Skip to content

Commit

Permalink
2024-09-04 13:46:19
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Sep 4, 2024
1 parent 211ea6c commit b614f7a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ QJS_OBJS=$(OBJDIR)/qjs.o $(OBJDIR)/quickjs.o $(OBJDIR)/libregexp.o $(OBJDIR)/lib
$(OBJDIR)/cutils.o $(OBJDIR)/mocked.o $(OBJDIR)/std_module.o $(OBJDIR)/ckb_module.o $(OBJDIR)/ckb_cell_fs.o \
$(OBJDIR)/libbf.o $(OBJDIR)/cmdopt.o

STD_OBJS=$(OBJDIR)/malloc_impl.o $(OBJDIR)/printf_impl.o $(OBJDIR)/stdio_impl.o
STD_OBJS=$(OBJDIR)/printf_impl.o $(OBJDIR)/stdio_impl.o


all: build/ckb-js-vm
Expand Down
2 changes: 1 addition & 1 deletion deps/musl
Submodule musl updated 1 files
+22 −0 ckb/hijack_syscall.c
24 changes: 12 additions & 12 deletions tests/basic/test_builtin.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function test_function()
}

var r, g;

r = my_func.call(null, 1, 2);
assert(r, 3, "call");

Expand All @@ -70,10 +70,10 @@ function test_function()
assert_throws(TypeError, (function() {
Reflect.apply((function () { return 1; }), null, undefined);
}));

r = new Function("a", "b", "return a + b;");
assert(r(2,3), 5, "function");

g = f.bind(1, 2);
assert(g.length, 1);
assert(g.name, "bound f");
Expand Down Expand Up @@ -103,7 +103,7 @@ function test()
assert(a.z, 4, "get");
a.z = 5;
assert(a.z_val, 5, "set");

a = { get z() { return 4; }, set z(val) { this.z_val = val; } };
assert(a.z, 4, "get");
a.z = 5;
Expand Down Expand Up @@ -207,7 +207,7 @@ function test_string()
assert(a.charAt(1), "b");
assert(a.charAt(-1), "");
assert(a.charAt(3), "");

a = "abcd";
assert(a.substring(1, 3), "bc", "substring");
a = String.fromCharCode(0x20ac);
Expand All @@ -216,7 +216,7 @@ function test_string()
assert(a, "\u20ac", "unicode");
assert(a, "\u{20ac}", "unicode");
assert("a", "\x61", "unicode");

a = "\u{10ffff}";
assert(a.length, 2, "unicode");
assert(a, "\u{dbff}\u{dfff}", "unicode");
Expand Down Expand Up @@ -380,7 +380,7 @@ function test_eval()
assert(eval("if (0) 2; else 3;"), 3);

assert(f.call(1, "this"), 1);

a = 2;
assert(eval("a"), 2);

Expand Down Expand Up @@ -425,7 +425,7 @@ function test_typed_array()
a[2] = 0.5;
a[3] = 1233.5;
assert(a.toString(), "0,2,0,255");

buffer = new ArrayBuffer(16);
assert(buffer.byteLength, 16);
a = new Uint32Array(buffer, 12, 1);
Expand All @@ -437,7 +437,7 @@ function test_typed_array()

a = new Float32Array(buffer, 8, 1);
a[0] = 1;

a = new Uint8Array(buffer);

str = a.toString();
Expand Down Expand Up @@ -526,7 +526,7 @@ function test_regexp()

a = /(\.(?!com|org)|\/)/.exec("ah.com");
assert(a, null);

a = /(?=(a+))/.exec("baaabac");
assert(a.index === 1 && a[0] === "" && a[1] === "aaa");

Expand Down Expand Up @@ -593,7 +593,7 @@ function test_map()
}

i = 0;
a.forEach(function (v, o) {
a.forEach(function (v, o) {
assert(o, tab[i++][0]);
assert(a.has(o));
assert(a.delete(o));
Expand All @@ -616,7 +616,7 @@ function test_weak_map()
a.set(o, v);
}
o = null;

n2 = n >> 1;
for(i = 0; i < n2; i++) {
a.delete(tab[i][0]);
Expand Down

0 comments on commit b614f7a

Please sign in to comment.