Browse Source

bug testcase to demonstrate raw_string_to_arrayindex() incorrectness impact

pull/1/head
Sami Vaarala 11 years ago
parent
commit
ae44635bb1
  1. 20
      ecmascript-testcases/test-dev-bug-arridx-1.js

20
ecmascript-testcases/test-dev-bug-arridx-1.js

@ -0,0 +1,20 @@
/*
* Development time bug caused by too lenient string-to-array-index
* conversion.
*/
/*===
quux
quux
undefined
===*/
try {
var arr = [ 'foo', 'bar', 'quux', 'baz' ];
print(arr[2]);
print(arr['2']);
print(arr['02']); // should be undefined, '02' is not an array index compatible string
} catch (e) {
print(e);
}
Loading…
Cancel
Save