зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1287525 - Part 1: Do not use RegExp.prototype[@@split] optimized path if |this| object has extra property. r=h4writer
This commit is contained in:
Родитель
414b89d4d3
Коммит
1de3de00d8
|
@ -579,6 +579,7 @@ function IsRegExpSplitOptimizable(rx, C) {
|
|||
// If RegExpPrototypeOptimizable succeeds, `RegExpProto.exec` is guaranteed
|
||||
// to be a data property.
|
||||
return RegExpPrototypeOptimizable(RegExpProto) &&
|
||||
RegExpInstanceOptimizable(rx, RegExpProto) &&
|
||||
RegExpProto.exec === RegExp_prototype_Exec;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
var BUGNUMBER = 1287525;
|
||||
var summary = 'String.prototype.split should call ToUint32(limit) before ToString(separator).';
|
||||
|
||||
print(BUGNUMBER + ": " + summary);
|
||||
|
||||
var accessed = false;
|
||||
|
||||
var rx = /a/;
|
||||
Object.defineProperty(rx, Symbol.match, {
|
||||
get() {
|
||||
accessed = true;
|
||||
}
|
||||
});
|
||||
rx[Symbol.split]("abba");
|
||||
|
||||
assertEq(accessed, true);
|
||||
|
||||
if (typeof reportCompare === "function")
|
||||
reportCompare(true, true);
|
Загрузка…
Ссылка в новой задаче