regress-591846.js (906B)
1 // |reftest| shell-option(--enable-legacy-regexp) skip-if(release_or_beta||!xulRuntime.shell) -- legacy-regexp is not released yet, requires shell-options 2 /* 3 * Any copyright is dedicated to the Public Domain. 4 * http://creativecommons.org/licenses/publicdomain/ 5 */ 6 7 // SKIP test262 export 8 // This test verifies that RegExp legacy static properties match TC39's expected 9 // attributes: non-enumerable and configurable. 10 // See: https://github.com/tc39/proposal-regexp-legacy-features 11 12 // Reset RegExp.leftContext to the empty string. 13 /x/.test('x'); 14 15 var d = Object.getOwnPropertyDescriptor(RegExp, "leftContext"); 16 assertEq(d.set, undefined); 17 assertEq(typeof d.get, "function"); 18 let regexpLegacyFeatures = getPrefValue('experimental.legacy_regexp'); 19 assertEq(d.enumerable, !regexpLegacyFeatures); 20 assertEq(d.configurable, regexpLegacyFeatures); 21 assertEq(d.get.call(RegExp), ""); 22 23 reportCompare(0, 0, "ok");