espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.75k stars 739 forks source link

ASSERT(jsvHasCharacterData(str)) FAILED AT src/jsvariterator.c:256 #2364

Closed Limesss closed 1 year ago

Limesss commented 1 year ago

Reproduce Make Debug=1

POC:


assert = function () {};

assert.sameValue = () => {};

assert.notSameValue = () => {};

assert.throws = () => {};

try {
  var f = new Function(null);
} catch (e) {
  throw new Test262Error('#1: test fails with error ' + e);
}

assert.sameValue(f.constructor, Function, 'The value of f.constructor is expected to equal the value of Function');
assert.sameValue(f(), undefined, 'f() returns undefined');

reportCompare(0, 0);

details: ASSERT(jsvHasCharacterData(str)) FAILED AT src/jsvariterator.c:256

1[r2,l2] Object {

#2[r1,l2] Name String [1 blocks] "\xFF"      #3[r1,l1] Object { 
    #6[r1,l2] Name String [1 blocks] "timers"          #7[r2,l0] Array(0) [ ] 
    #8[r1,l2] Name String [1 blocks] "watches"          #9[r2,l0] Array(0) [ ] 
  } 
#11[r1,l2] Name String [1 blocks] "quit"      #10[r1,l0] NativeFunction 0x816da100 (0) { } 
#33[r1,l2] Name String [1 blocks] "assert"      #34[r1,l2] Function { 
    #35[r1,l3] Name String [2 blocks] "sameValue"          #37[r1,l1] Function { } 
    #38[r1,l2] Name String [2 blocks] "notSameValue"          #40[r1,l0] Function { } 
    #41[r1,l2] Name String [1 blocks] "throws"          #42[r1,l0] Function { } 
  } 
#43[r1,l3] Name String [1 blocks] "f"      #57[r1,l1] Function { 
    #58[r1,l2] Name String [1 blocks] "\xFFcod"          #54[r1,l2] Unknown 2  
  } 
#45[r1,l2] Name String [1 blocks] "Function"      #44[r2,l0] NativeFunction 0x816e3a65 (17) { 
    #47[r1,l2] Name String [2 blocks] "prototype"          #49[r1,l0] Object { 
        #50[r1,l2] Name String [2 blocks] "constructor"              #44[r2,l0] ...

      } 
  } 

}