Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // https://github.com/tc39/proposal-regexp-legacy-features#additional-properties -of-the-regexp-constructor | |
| 6 | |
| 7 const re = /./; | |
| 8 | |
| 9 re.exec("abc"); | |
| 10 | |
| 11 const props = [ "input", "$_" | |
| 12 , "lastMatch", "$&" | |
| 13 , "lastParen", "$+" | |
| 14 , "leftContext", "$`" | |
| 15 , "rightContext", "$'" | |
| 16 , "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9" | |
| 17 ]; | |
| 18 | |
| 19 for (let i = 0; i < props.length; i++) { | |
| 20 const prop = props[i]; | |
| 21 assertTrue(Object.getOwnPropertyDescriptor(RegExp, prop).configurable, prop); | |
| 22 assertFalse(Object.getOwnPropertyDescriptor(RegExp, prop).enumerable, prop); | |
|
Dan Ehrenberg
2016/10/26 08:36:41
While you're looking at the property descriptors,
jgruber
2016/10/26 09:30:43
Done, and also changed setters to be undefined ins
| |
| 23 } | |
| OLD | NEW |