Browse Source

Fix isFastint polyfill for new tag numbers

The new fastint detection works for both old and new packed boolean tag
(0xfff4 in Duktape 1.3.0, 0xfff5 now).
pull/396/head
Sami Vaarala 9 years ago
parent
commit
3fbd785183
  1. 2
      polyfills/duktape-isfastint.js

2
polyfills/duktape-isfastint.js

@ -16,7 +16,7 @@ if (typeof Duktape === 'object') {
if (typeof Duktape.fastintTag === 'undefined') {
Object.defineProperty(Duktape, 'fastintTag', {
/* Tag number depends on duk_tval packing. */
value: (Duktape.info(true)[1] === 0xfff4) ?
value: (Duktape.info(true)[1] >= 0xfff0) ?
0xfff1 /* tag for packed duk_tval */ :
1 /* tag for unpacked duk_tval */,
writable: false,

Loading…
Cancel
Save