diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-06-28 03:53:35 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-06-28 08:55:14 +0100 |
commit | e2e695bc9f23e4f12b05026b82e5c6eab52562d2 (patch) | |
tree | f4716f730409f1a3b48e40000c7729296a6d3e34 /Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp | |
parent | 581f20e6f2425e1bdbee04218f6bfa1b859f0ed2 (diff) | |
download | serenity-e2e695bc9f23e4f12b05026b82e5c6eab52562d2.zip |
LibJS: Add and use the %ThrowTypeError% intrinsic
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp index 149d10ae6b..bf3b1f10cf 100644 --- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp @@ -210,7 +210,6 @@ Value perform_eval(Value x, GlobalObject& caller_realm, CallerMode strict_caller Object* create_unmapped_arguments_object(GlobalObject& global_object, Vector<Value> const& arguments) { auto& vm = global_object.vm(); - // FIXME: This should use OrdinaryObjectCreate auto* object = Object::create(global_object, global_object.object_prototype()); if (vm.exception()) return nullptr; @@ -226,12 +225,8 @@ Object* create_unmapped_arguments_object(GlobalObject& global_object, Vector<Val for (auto& argument : arguments) object->indexed_properties().append(argument); - // FIXME: 8. Perform ! DefinePropertyOrThrow(obj, "callee", PropertyDescriptor { [[Get]]: %ThrowTypeError%, [[Set]]: %ThrowTypeError%, [[Enumerable]]: false, [[Configurable]]: false }). - PropertyAttributes attributes; - attributes.set_has_configurable(); - attributes.set_has_enumerable(); - - object->define_property(vm.names.callee, js_undefined(), attributes); + // 8. Perform ! DefinePropertyOrThrow(obj, "callee", PropertyDescriptor { [[Get]]: %ThrowTypeError%, [[Set]]: %ThrowTypeError%, [[Enumerable]]: false, [[Configurable]]: false }). + object->define_accessor(vm.names.callee, global_object.throw_type_error_function(), global_object.throw_type_error_function(), 0); if (vm.exception()) return nullptr; |