| OLD | NEW |
| (Empty) |
| 1 This page tests that a RegExp object's lastIndex behaves like a regular property
. | |
| 2 | |
| 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
| 4 | |
| 5 | |
| 6 PASS delete /x/.lastIndex is false | |
| 7 PASS 'use strict'; delete /x/.lastIndex threw exception TypeError: Cannot delete
property 'lastIndex' of [object RegExp]. | |
| 8 PASS 'lastIndex' in /x/ is true | |
| 9 PASS for (property in /x/) if (property === 'lastIndex') throw false; true is tr
ue | |
| 10 PASS var re = /x/; re.lastIndex = re; re.lastIndex === re is true | |
| 11 PASS Object.defineProperty(/x/, {get:function(){}}) threw exception TypeError: P
roperty description must be an object: undefined. | |
| 12 PASS Object.defineProperty(/x/, 'lastIndex', {enumerable:true}); true threw exce
ption TypeError: Cannot redefine property: lastIndex. | |
| 13 PASS Object.defineProperty(/x/, 'lastIndex', {enumerable:false}); true is true | |
| 14 PASS Object.defineProperty(/x/, 'lastIndex', {configurable:true}); true threw ex
ception TypeError: Cannot redefine property: lastIndex. | |
| 15 PASS Object.defineProperty(/x/, 'lastIndex', {configurable:false}); true is true | |
| 16 PASS var re = Object.defineProperty(/x/, 'lastIndex', {writable:true}); re.lastI
ndex = 42; re.lastIndex is 42 | |
| 17 PASS var re = Object.defineProperty(/x/, 'lastIndex', {writable:false}); re.last
Index = 42; re.lastIndex is 0 | |
| 18 PASS var re = Object.defineProperty(/x/, 'lastIndex', {value:42}); re.lastIndex
is 42 | |
| 19 PASS Object.defineProperty(Object.defineProperty(/x/, 'lastIndex', {writable:fal
se}), 'lastIndex', {writable:true}); true threw exception TypeError: Cannot rede
fine property: lastIndex. | |
| 20 PASS Object.defineProperty(Object.defineProperty(/x/, 'lastIndex', {writable:fal
se}), 'lastIndex', {value:42}); true threw exception TypeError: Cannot redefine
property: lastIndex. | |
| 21 PASS Object.defineProperty(Object.defineProperty(/x/, 'lastIndex', {writable:fal
se}), 'lastIndex', {value:0}); true is true | |
| 22 PASS Object.defineProperty(/x/, 'lastIndex', {writable:false}).exec('') is null | |
| 23 PASS Object.defineProperty(/x/, 'lastIndex', {writable:false}).exec('x') is ["x"
] | |
| 24 FAIL Object.defineProperty(/x/g, 'lastIndex', {writable:false}).exec('') should
throw an exception. Was null. | |
| 25 FAIL Object.defineProperty(/x/g, 'lastIndex', {writable:false}).exec('x') should
throw an exception. Was x. | |
| 26 PASS var re = /x/; Object.freeze(re); Object.isFrozen(re); is true | |
| 27 PASS successfullyParsed is true | |
| 28 | |
| 29 TEST COMPLETE | |
| 30 | |
| OLD | NEW |