(t *testing.T)
| 5 | ) |
| 6 | |
| 7 | func TestSparseArraySetLengthWithPropItems(t *testing.T) { |
| 8 | const SCRIPT = ` |
| 9 | var a = [1,2,3,4]; |
| 10 | a[100000] = 5; |
| 11 | var thrown = false; |
| 12 | |
| 13 | Object.defineProperty(a, "2", {value: 42, configurable: false, writable: false}); |
| 14 | try { |
| 15 | Object.defineProperty(a, "length", {value: 0, writable: false}); |
| 16 | } catch (e) { |
| 17 | thrown = e instanceof TypeError; |
| 18 | } |
| 19 | thrown && a.length === 3; |
| 20 | ` |
| 21 | |
| 22 | testScript(SCRIPT, valueTrue, t) |
| 23 | } |
| 24 | |
| 25 | func TestSparseArraySwitch(t *testing.T) { |
| 26 | vm := New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…