Browse Source

Miscellaneous lightfunc fixes

- Call handling assert
- Test case FIXME removal
pull/92/head
Sami Vaarala 10 years ago
parent
commit
6bc35e4281
  1. 2
      ecmascript-testcases/test-bi-duktape-json-lightfunc.js
  2. 4
      src/duk_js_call.c

2
ecmascript-testcases/test-bi-duktape-json-lightfunc.js

@ -22,7 +22,7 @@ string {"foo":123,"bar":{"_func":true}}
===*/
function test() {
// FIXME: rely on Math.cos being a lightfunc
// Note: rely on Math.cos being a lightfunc
var lf = Math.cos;
function json(x) {

4
src/duk_js_call.c

@ -1028,6 +1028,10 @@ duk_int_t duk_handle_call(duk_hthread *thr,
DUK_TVAL_SET_TVAL(&tv_func_copy, tv_func);
tv_func = &tv_func_copy; /* local copy to avoid relookups */
DUK_ASSERT(func == NULL || !DUK_HOBJECT_HAS_BOUND(func));
DUK_ASSERT(func == NULL || (DUK_HOBJECT_IS_COMPILEDFUNCTION(func) ||
DUK_HOBJECT_IS_NATIVEFUNCTION(func)));
duk__coerce_effective_this_binding(thr, func, idx_func + 1);
DUK_DDD(DUK_DDDPRINT("effective 'this' binding is: %!T",
(duk_tval *) duk_get_tval(ctx, idx_func + 1)));

Loading…
Cancel
Save