浏览代码

LibJS: Add "at" to Array.prototype[@@unscopables]

Linus Groh 3 年之前
父节点
当前提交
d655a0a42e
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp

+ 1 - 0
Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp

@@ -82,6 +82,7 @@ void ArrayPrototype::initialize(GlobalObject& global_object)
     // 23.1.3.35 Array.prototype [ @@unscopables ], https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
     // With proposal, https://tc39.es/proposal-array-find-from-last/index.html#sec-array.prototype-@@unscopables
     auto* unscopable_list = Object::create(global_object, nullptr);
+    MUST(unscopable_list->create_data_property_or_throw(vm.names.at, Value(true)));
     MUST(unscopable_list->create_data_property_or_throw(vm.names.copyWithin, Value(true)));
     MUST(unscopable_list->create_data_property_or_throw(vm.names.entries, Value(true)));
     MUST(unscopable_list->create_data_property_or_throw(vm.names.fill, Value(true)));