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 props = [ "input", "$_" | |
| 8 , "lastMatch", "$&" | |
| 9 , "lastParen", "$+" | |
| 10 , "leftContext", "$`" | |
| 11 , "rightContext", "$'" | |
| 12 , "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9" | |
| 13 ]; | |
| 14 | |
| 15 for (let i = 0; i < props.length; i++) { | |
| 16 const prop = props[i]; | |
| 17 const desc = Object.getOwnPropertyDescriptor(RegExp, prop); | |
| 18 assertTrue(desc.configurable, prop); | |
| 19 assertFalse(desc.enumerable, prop); | |
| 20 assertTrue(desc.get !== undefined, prop); | |
|
Dan Ehrenberg
2016/10/26 11:14:27
Since we left it this way on purpose, how about de
jgruber
2016/10/27 07:48:15
Done.
| |
| 21 } | |
| OLD | NEW |