Home | History | Annotate | Download | only in regex

Lines Matching full:lastindex

24 This page tests that a RegExp object's lastIndex behaves like a regular property.
29 PASS delete /x/.lastIndex is false
30 PASS 'use strict'; delete /x/.lastIndex threw exception TypeError: Cannot delete property 'lastIndex' of [object RegExp].
31 PASS 'lastIndex' in /x/ is true
32 PASS for (property in /x/) if (property === 'lastIndex') throw false; true is true
33 PASS var re = /x/; re.lastIndex = re; re.lastIndex === re is true
35 PASS Object.defineProperty(/x/, 'lastIndex', {enumerable:true}); true threw exception TypeError: Cannot redefine property: lastIndex.
36 PASS Object.defineProperty(/x/, 'lastIndex', {enumerable:false}); true is true
37 PASS Object.defineProperty(/x/, 'lastIndex', {configurable:true}); true threw exception TypeError: Cannot redefine property: lastIndex.
38 PASS Object.defineProperty(/x/, 'lastIndex', {configurable:false}); true is true
39 PASS var re = Object.defineProperty(/x/, 'lastIndex', {writable:true}); re.lastIndex = 42; re.lastIndex is 42
40 PASS var re = Object.defineProperty(/x/, 'lastIndex', {writable:false}); re.lastIndex = 42; re.lastIndex is 0
41 PASS var re = Object.defineProperty(/x/, 'lastIndex', {value:42}); re.lastIndex is 42
42 PASS Object.defineProperty(Object.defineProperty(/x/, 'lastIndex', {writable:false}), 'lastIndex', {writable:true}); true threw exception TypeError: Cannot redefine property: lastIndex.
43 PASS Object.defineProperty(Object.defineProperty(/x/, 'lastIndex', {writable:false}), 'lastIndex', {value:42}); true threw exception TypeError: Cannot redefine property: lastIndex.
44 PASS Object.defineProperty(Object.defineProperty(/x/, 'lastIndex', {writable:false}), 'lastIndex', {value:0}); true is true
45 PASS Object.defineProperty(/x/, 'lastIndex', {writable:false}).exec('') is null
46 PASS Object.defineProperty(/x/, 'lastIndex', {writable:false}).exec('x') is ["x"]
47 FAIL Object.defineProperty(/x/g, 'lastIndex', {writable:false}).exec('') should throw an exception. Was null.
48 FAIL Object.defineProperty(/x/g, 'lastIndex', {writable:false}).exec('x') should throw an exception. Was x.