Skip to content

Commit

Permalink
更新到2019-09-01版本
Browse files Browse the repository at this point in the history
  • Loading branch information
llgoer committed Sep 1, 2019
1 parent d0cad46 commit 2608b16
Show file tree
Hide file tree
Showing 24 changed files with 391 additions and 208 deletions.
8 changes: 8 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2019-09-01:

- added globalThis
- documented JS_EVAL_FLAG_COMPILE_ONLY
- added import.meta.url and import.meta.main
- added 'debugger' statement
- misc bug fixes

2019-08-18:

- added os.realpath, os.getcwd, os.mkdir, os.stat, os.lstat,
Expand Down
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

6 changes: 3 additions & 3 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ REPL:
Test262o: 0/11262 errors, 463 excluded
Test262o commit: 7da91bceb9ce7613f87db47ddd1292a2dda58b42 (es5-tests branch)

Test262: 2/67090 errors, 842 excluded, 1386 skipped
Test262bn: 2/69191 errors, 775 excluded, 399 skipped
test262 commit: 59a1a016b7cf5cf43f66b274c7d1db4ec6066935
Test262: 2/67303 errors, 839 excluded, 1390 skipped
Test262bn: 2/69404 errors, 772 excluded, 403 skipped
test262 commit: b63cdfd4f4a00f5fdb732778244d3456725f46c9
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2019-08-18
2019-09-01
1 change: 0 additions & 1 deletion cutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ void rqsort(void *base, size_t nmemb, size_t size, cmp_f cmp, void *opaque)
*/
span = plt - ptr;
span2 = pi - plt;
plt = pi - span;
lt = i - lt;
if (span > span2)
span = span2;
Expand Down
21 changes: 9 additions & 12 deletions doc/jsbignum.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified doc/jsbignum.pdf
Binary file not shown.
2 changes: 0 additions & 2 deletions doc/jsbignum.texi
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,6 @@ The following changes are visible:

@item Operators with integer operands never return the minus zero floating point value as result. Hence @code{Object.is(0, -0) === true}. Use @code{-0.0} to create a minus zero floating point value.

@item Division or modulo with a zero integer dividend raises an exception i.e. @code{1/0} throws a @code{RangeError} exception. However, division by the floating point zero returns Infinity or NaN as in standard mode: @code{1/0.0 === Infinity}. The same holds for zero elevated to a negative integer power i.e. @code{0**-1} throws a @code{RangeError} exception.

@item The @code{ToPrimitive} abstract operation is called with the @code{"integer"} preferred type when an integer is required (e.g. for bitwise binary or shift operations).

@item The prototype of integers is no longer @code{Number.prototype}. Instead@* @code{Object.getPrototypeOf(1) === BigInt.prototype}. The prototype of floats remains Number.prototype.
Expand Down
27 changes: 11 additions & 16 deletions doc/quickjs.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified doc/quickjs.pdf
Binary file not shown.
7 changes: 2 additions & 5 deletions doc/quickjs.texi
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ options of the test262 runner.
@code{test262-harness}@footnote{@url{https://github.com/bterlson/test262-harness}}
thru @code{eshost}. Unless you want to compare QuickJS with other
engines under the same conditions, we do not recommend to run the
tests this way as it is much slower (typically more than one hour
instead of about 100 seconds).
tests this way as it is much slower (typically half an hour instead of
about 100 seconds).

@chapter Specifications

Expand Down Expand Up @@ -424,9 +424,6 @@ Wrappers to the libc file @code{stdin}, @code{stdout}, @code{stderr}.
@item SEEK_END
Constants for seek().

@item global
Reference to the global object.

@item gc()
Manually invoke the cycle removal algorithm. The cycle removal
algorithm is automatically started when needed, so this function is
Expand Down
16 changes: 14 additions & 2 deletions qjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,18 @@ static int eval_buf(JSContext *ctx, const void *buf, int buf_len,
JSValue val;
int ret;

val = JS_Eval(ctx, buf, buf_len, filename, eval_flags);
if ((eval_flags & JS_EVAL_TYPE_MASK) == JS_EVAL_TYPE_MODULE) {
/* for the modules, we compile then run to be able to set
import.meta */
val = JS_Eval(ctx, buf, buf_len, filename,
eval_flags | JS_EVAL_FLAG_COMPILE_ONLY);
if (!JS_IsException(val)) {
js_module_set_import_meta(ctx, val, TRUE, TRUE);
val = JS_EvalFunction(ctx, val);
}
} else {
val = JS_Eval(ctx, buf, buf_len, filename, eval_flags);
}
if (JS_IsException(val)) {
js_std_dump_error(ctx);
ret = -1;
Expand All @@ -78,7 +89,8 @@ static int eval_file(JSContext *ctx, const char *filename, int module)
}

if (module < 0) {
module = JS_DetectModule((const char *)buf, buf_len);
module = (has_suffix(filename, ".mjs") ||
JS_DetectModule((const char *)buf, buf_len));
}
if (module)
eval_flags = JS_EVAL_TYPE_MODULE;
Expand Down
5 changes: 3 additions & 2 deletions qjsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ static void compile_file(JSContext *ctx, FILE *fo,
}
eval_flags = JS_EVAL_FLAG_COMPILE_ONLY;
if (module < 0) {
module = JS_DetectModule((const char *)buf, buf_len);
module = (has_suffix(filename, ".mjs") ||
JS_DetectModule((const char *)buf, buf_len));
}
if (module)
eval_flags |= JS_EVAL_TYPE_MODULE;
Expand Down Expand Up @@ -648,7 +649,7 @@ int main(int argc, char **argv)
namelist_entry_t *e = &cname_list.array[i];
fprintf(fo, " js_std_eval_binary(ctx, %s, %s_size, %s);\n",
e->name, e->name,
e->flags ? "JS_EVAL_BINARY_LOAD_ONLY" : "0");
e->flags ? "1" : "0");
}
fputs(main_c_template2, fo);
}
Expand Down
1 change: 1 addition & 0 deletions quickjs-atom.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ DEF(exec, "exec")
DEF(groups, "groups")
DEF(status, "status")
DEF(reason, "reason")
DEF(globalThis, "globalThis")
#ifdef CONFIG_BIGNUM
DEF(bigint, "bigint")
DEF(bigfloat, "bigfloat")
Expand Down
Loading

0 comments on commit 2608b16

Please sign in to comment.