Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Function internal methods and implement BoundFunction objects #1583

Merged
merged 3 commits into from
Oct 11, 2021

Conversation

jedel1043
Copy link
Member

@jedel1043 jedel1043 commented Sep 16, 2021

This Pull Request fixes/closes #1579.

It changes the following:

  • Refactors [[Call]] and [[Construct]] to be InternalFunctions
  • Implements BoundFunction exotic objects
  • Implements remaining Function builtin methods
  • Lifts OrdinaryHasInstance to be inside JsValue
  • Implements JsValue::InstanceOf operator inside JsValue
  • Implements JsValue::[as/is]_callable
  • Implements JsValue::[as/is]_constructor
  • Changes the return type of JsValue::as_object to be &JsObject
  • Removes JsValue::as_function
  • Documents some functions
  • Enables mutability for the Closure type inside closures

@jedel1043 jedel1043 changed the title Refactor Function objects and document code Refactor Function internal methods and implement BoundFunction objects Sep 16, 2021
@github-actions
Copy link

github-actions bot commented Sep 16, 2021

Test262 conformance changes:

Test result main count PR count difference
Total 86,438 86,438 0
Passed 37,456 37,716 +260
Ignored 19,022 19,022 0
Failed 29,960 29,700 -260
Panics 0 0 0
Conformance 43.33% 43.63% +0.30%
Fixed tests (260):
test/built-ins/ArrayBuffer/prototype-from-newtarget.js [strict mode] (previously Failed)
test/built-ins/ArrayBuffer/prototype-from-newtarget.js (previously Failed)
test/built-ins/ArrayBuffer/data-allocation-after-object-creation.js [strict mode] (previously Failed)
test/built-ins/ArrayBuffer/data-allocation-after-object-creation.js (previously Failed)
test/built-ins/ArrayBuffer/prototype/slice/species-returns-smaller-arraybuffer.js [strict mode] (previously Failed)
test/built-ins/ArrayBuffer/prototype/slice/species-returns-smaller-arraybuffer.js (previously Failed)
test/built-ins/ArrayBuffer/prototype/slice/species-returns-not-arraybuffer.js [strict mode] (previously Failed)
test/built-ins/ArrayBuffer/prototype/slice/species-returns-not-arraybuffer.js (previously Failed)
test/built-ins/ArrayBuffer/prototype/slice/species-returns-same-arraybuffer.js [strict mode] (previously Failed)
test/built-ins/ArrayBuffer/prototype/slice/species-returns-same-arraybuffer.js (previously Failed)
test/built-ins/ArrayBuffer/prototype/slice/species.js [strict mode] (previously Failed)
test/built-ins/ArrayBuffer/prototype/slice/species.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/custom-proto-access-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/object-arg/custom-proto-access-throws.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/no-args/custom-proto-access-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/no-args/custom-proto-access-throws.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-buffer-ctor-species-prototype-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/same-ctor-buffer-ctor-species-prototype-throws.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/detached-when-species-retrieved-different-type.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/detached-when-species-retrieved-different-type.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-species-prototype-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/other-ctor-buffer-ctor-species-prototype-throws.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/custom-proto-access-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/custom-proto-access-throws.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/custom-proto-access-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/length-arg/custom-proto-access-throws.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/custom-proto-access-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors-bigint/buffer-arg/custom-proto-access-throws.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/object-arg/custom-proto-access-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/object-arg/custom-proto-access-throws.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/no-args/custom-proto-access-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/no-args/custom-proto-access-throws.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-buffer-ctor-species-prototype-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-buffer-ctor-species-prototype-throws.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/detached-when-species-retrieved-different-type.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/detached-when-species-retrieved-different-type.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/other-ctor-buffer-ctor-species-prototype-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/other-ctor-buffer-ctor-species-prototype-throws.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/custom-proto-access-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/typedarray-arg/custom-proto-access-throws.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/length-arg/custom-proto-access-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/length-arg/custom-proto-access-throws.js (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/buffer-arg/custom-proto-access-throws.js [strict mode] (previously Failed)
test/built-ins/TypedArrayConstructors/ctors/buffer-arg/custom-proto-access-throws.js (previously Failed)
test/built-ins/Function/15.3.5.4_2-90gs.js (previously Failed)
test/built-ins/Function/15.3.5.4_2-97gs.js (previously Failed)
test/built-ins/Function/15.3.5.4_2-93gs.js (previously Failed)
test/built-ins/Function/15.3.5.4_2-91gs.js (previously Failed)
test/built-ins/Function/15.3.5.4_2-92gs.js (previously Failed)
test/built-ins/Function/15.3.5.4_2-89gs.js (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/value-negative.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/value-negative.js (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/value-non-obj.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/value-non-obj.js (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/length.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/length.js (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/this-val-not-callable.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/this-val-not-callable.js (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/prop-desc.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/prop-desc.js (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/this-val-bound-target.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/this-val-bound-target.js (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/value-positive.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/Symbol.hasInstance/value-positive.js (previously Failed)
test/built-ins/Function/prototype/bind/S15.3.4.5_A4.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/S15.3.4.5_A4.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-11.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-11.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-0-1.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-0-1.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-8.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-8.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-7.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-7.js (previously Failed)
test/built-ins/Function/prototype/bind/instance-length-prop-desc.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/instance-length-prop-desc.js (previously Failed)
test/built-ins/Function/prototype/bind/instance-length-tointeger.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/instance-length-tointeger.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-2.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-2.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-8-1.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-8-1.js (previously Failed)
test/built-ins/Function/prototype/bind/instance-name-error.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/instance-name-error.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-10.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-10.js (previously Failed)
test/built-ins/Function/prototype/bind/instance-name-non-string.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/instance-name-non-string.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-3.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-3.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-14.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-14.js (previously Failed)
test/built-ins/Function/prototype/bind/S15.3.4.5_A5.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/S15.3.4.5_A5.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-6.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-6.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-14.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-14.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-11.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-11.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-12.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-12.js (previously Failed)
test/built-ins/Function/prototype/bind/name.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/name.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-5.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-5.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-6.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-6.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-1.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-1.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-10.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-10.js (previously Failed)
test/built-ins/Function/prototype/bind/length.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/length.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-9.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-9.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-3.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-3.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-8.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-8.js (previously Failed)
test/built-ins/Function/prototype/bind/instance-name-chained.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/instance-name-chained.js (previously Failed)
test/built-ins/Function/prototype/bind/instance-length-remaining-args.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/instance-length-remaining-args.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-7.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-7.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-13.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-13.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-9.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-9.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-11.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-11.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-1.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-1.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-11-1.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-11-1.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-4.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-4.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-9-1.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-9-1.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-12.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-12.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-6.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-6.js (previously Failed)
test/built-ins/Function/prototype/bind/instance-length-exceeds-int32.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/instance-length-exceeds-int32.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-8.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-8.js (previously Failed)
test/built-ins/Function/prototype/bind/instance-length-default-value.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/instance-length-default-value.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-3-1.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-3-1.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-4.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-4.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-4.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-4.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-2.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-2.js (previously Failed)
test/built-ins/Function/prototype/bind/S15.3.4.5_A3.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/S15.3.4.5_A3.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-3.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-3.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-1.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-1.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-10.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-10.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-16-1.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-16-1.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-3.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-3.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-7.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-7.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-5.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-5.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-9-2.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-9-2.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-16.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-16.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-15.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-15.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-5.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-5.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-9.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-9.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-12.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-12.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-13.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-13.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-4.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-4.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-8.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-6-8.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-9.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-9.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-2.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.2-4-2.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-6.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-2-6.js (previously Failed)
test/built-ins/Function/prototype/bind/instance-name.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/instance-name.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-5.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5.1-4-5.js (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-16-2.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/bind/15.3.4.5-16-2.js (previously Failed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-38.js [strict mode] (previously Failed)
test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-38.js (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-593.js [strict mode] (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-593.js (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-595.js [strict mode] (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-595.js (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-417.js [strict mode] (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-417.js (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-611.js [strict mode] (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-611.js (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-420.js [strict mode] (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-420.js (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-596.js [strict mode] (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-596.js (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-594.js [strict mode] (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-594.js (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-421.js [strict mode] (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-421.js (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-419.js [strict mode] (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-419.js (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-597.js [strict mode] (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-597.js (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-418.js [strict mode] (previously Failed)
test/built-ins/Object/defineProperty/15.2.3.6-4-418.js (previously Failed)
test/built-ins/Array/prototype/flatMap/bound-function-argument.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/flatMap/bound-function-argument.js (previously Failed)
test/built-ins/Array/prototype/sort/S15.4.4.11_A1.5_T1.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/sort/S15.4.4.11_A1.5_T1.js (previously Failed)
test/built-ins/Array/prototype/flat/bound-function-call.js [strict mode] (previously Failed)
test/built-ins/Array/prototype/flat/bound-function-call.js (previously Failed)
test/built-ins/Array/of/return-a-new-array-object.js [strict mode] (previously Failed)
test/built-ins/Array/of/return-a-new-array-object.js (previously Failed)
test/language/function-code/10.4.3-1-77-s.js [strict mode] (previously Failed)
test/language/function-code/10.4.3-1-77-s.js (previously Failed)
test/language/function-code/10.4.3-1-76-s.js [strict mode] (previously Failed)
test/language/function-code/10.4.3-1-76-s.js (previously Failed)
test/language/function-code/10.4.3-1-77gs.js [strict mode] (previously Failed)
test/language/function-code/10.4.3-1-77gs.js (previously Failed)
test/language/function-code/10.4.3-1-98-s.js (previously Failed)
test/language/function-code/10.4.3-1-79gs.js [strict mode] (previously Failed)
test/language/function-code/10.4.3-1-79gs.js (previously Failed)
test/language/function-code/10.4.3-1-78-s.js [strict mode] (previously Failed)
test/language/function-code/10.4.3-1-78-s.js (previously Failed)
test/language/function-code/10.4.3-1-99gs.js (previously Failed)
test/language/function-code/10.4.3-1-78gs.js [strict mode] (previously Failed)
test/language/function-code/10.4.3-1-78gs.js (previously Failed)
test/language/function-code/10.4.3-1-79-s.js [strict mode] (previously Failed)
test/language/function-code/10.4.3-1-79-s.js (previously Failed)
test/language/function-code/10.4.3-1-80-s.js (previously Failed)
test/language/function-code/10.4.3-1-99-s.js (previously Failed)
test/language/function-code/10.4.3-1-76gs.js [strict mode] (previously Failed)
test/language/function-code/10.4.3-1-76gs.js (previously Failed)
test/language/function-code/10.4.3-1-98gs.js (previously Failed)
test/language/function-code/10.4.3-1-80gs.js (previously Failed)
test/language/expressions/arrow-function/lexical-this.js [strict mode] (previously Failed)
test/language/expressions/arrow-function/lexical-this.js (previously Failed)

@jedel1043 jedel1043 force-pushed the internal_call branch 3 times, most recently from 1920a73 to ddcae67 Compare September 16, 2021 09:56
@jedel1043 jedel1043 marked this pull request as ready for review September 16, 2021 10:08
@jedel1043 jedel1043 requested review from HalidOdat, raskad and RageKnify and removed request for HalidOdat and raskad September 16, 2021 10:08
@jedel1043 jedel1043 added API builtins PRs and Issues related to builtins/intrinsics labels Sep 16, 2021
Copy link
Member

@raskad raskad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really nice!

boa/src/builtins/regexp/mod.rs Outdated Show resolved Hide resolved
boa/src/value/mod.rs Show resolved Hide resolved
@jedel1043
Copy link
Member Author

jedel1043 commented Sep 16, 2021

Implemented [is/to]_[callable/constructor], making some patterns a bit easier to work with, and changed to_object to return &JsObject, unlocking some functional patterns that weren't possible when to_object returned a cloned Object; e.g.:

let mut map_iterator = this.as_object().map(|obj| obj.borrow_mut());
let map_iterator = map_iterator
    .as_mut()
    .and_then(|obj| obj.as_map_iterator_mut())
    .ok_or_else(|| context.construct_type_error("`this` is not a MapIterator"))?;
// code using `map_iterator`

Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me just needs a rebase :)

@jedel1043
Copy link
Member Author

@HalidOdat I can't currently move the construct and call methods from the vm to internal_methods because those methods take exit_on_return, and that conflicts with our implementations of call and construct. I'm gonna merge this as it is and then solve that in another PR.

@jedel1043 jedel1043 merged commit 9f84546 into main Oct 11, 2021
@jedel1043 jedel1043 deleted the internal_call branch October 11, 2021 00:41
@Razican Razican added this to the v0.14.0 milestone Feb 23, 2022
@RageKnify RageKnify added the Internal Category for changelog label Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API builtins PRs and Issues related to builtins/intrinsics Internal Category for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement [[Call]] and [[Construct]] as Object Internal Methods
5 participants