Add 'at' to Array.prototype[@@unscopables]
Bug: v8:10961 Change-Id: I3746dca570de005d203a2648dcffedd81122f215 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2553157 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Shu-yu Guo <syg@chromium.org> Commit-Queue: Gus Caplan <snek@chromium.org> Cr-Commit-Position: refs/heads/master@{#71377}
This commit is contained in:
parent
c229abea6d
commit
20b417503a
@ -4406,6 +4406,12 @@ void Genesis::InitializeGlobal_harmony_relative_indexing_methods() {
|
|||||||
|
|
||||||
SimpleInstallFunction(isolate(), array_prototype, "at",
|
SimpleInstallFunction(isolate(), array_prototype, "at",
|
||||||
Builtins::kArrayPrototypeAt, 1, true);
|
Builtins::kArrayPrototypeAt, 1, true);
|
||||||
|
|
||||||
|
Handle<JSObject> unscopables = Handle<JSObject>::cast(
|
||||||
|
JSReceiver::GetProperty(isolate(), array_prototype,
|
||||||
|
factory()->unscopables_symbol())
|
||||||
|
.ToHandleChecked());
|
||||||
|
InstallTrueValuedProperty(isolate(), unscopables, "at");
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -45,3 +45,5 @@ assertThrows(() => {
|
|||||||
a.at(0);
|
a.at(0);
|
||||||
}, TypeError);
|
}, TypeError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assertEquals(Array.prototype[Symbol.unscopables].at, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user