Commit 20b41750 authored by Gus Caplan's avatar Gus Caplan Committed by Commit Bot

Add 'at' to Array.prototype[@@unscopables]

Bug: v8:10961
Change-Id: I3746dca570de005d203a2648dcffedd81122f215
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2553157Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Commit-Queue: Gus Caplan <snek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71377}
parent c229abea
......@@ -4406,6 +4406,12 @@ void Genesis::InitializeGlobal_harmony_relative_indexing_methods() {
SimpleInstallFunction(isolate(), array_prototype, "at",
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);
}, TypeError);
}
assertEquals(Array.prototype[Symbol.unscopables].at, true);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment