call_with_regexp_match_falsy.js (790B)
1 // Copyright (C) 2015 André Bargull. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 description: RegExp returns a new object if constructor is not same-value 6 info: | 7 21.2.3.1 RegExp ( pattern, flags ) 8 9 ... 10 4. Else, 11 a. Let newTarget be the active function object. 12 b. If patternIsRegExp is true and flags is undefined, then 13 i. Let patternConstructor be Get(pattern, "constructor"). 14 ii. ReturnIfAbrupt(patternConstructor). 15 iii. If SameValue(newTarget, patternConstructor) is true, return pattern. 16 es6id: 21.2.3.1 17 features: [Symbol.match] 18 ---*/ 19 20 var regExpObj = /(?:)/; 21 regExpObj[Symbol.match] = false; 22 23 assert.notSameValue(RegExp(regExpObj), regExpObj, "RegExp returns new object"); 24 25 reportCompare(0, 0);