-
-
Notifications
You must be signed in to change notification settings - Fork 411
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 internal methods and make some builtins spec compliant #1422
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HalidOdat
added
bug
Something isn't working
technical debt
builtins
PRs and Issues related to builtins/intrinsics
execution
Issues or PRs related to code execution
labels
Jul 22, 2021
Test262 conformance changes:
Fixed tests:
New panics:
|
Benchmark for 660b265Click to view benchmark
|
HalidOdat
force-pushed
the
refactor/builtins
branch
from
July 22, 2021 12:12
c174e92
to
82cd2c9
Compare
Benchmark for d2f544eClick to view benchmark
|
HalidOdat
force-pushed
the
refactor/builtins
branch
from
July 22, 2021 18:42
82cd2c9
to
a639899
Compare
Benchmark for cf55bcfClick to view benchmark
|
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
builtins
PRs and Issues related to builtins/intrinsics
execution
Issues or PRs related to code execution
technical debt
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We currently have the internal object method such as
set
(which in reality is[[set]]
) the problem is that we do not differentiate betweenSet
and[[set]]
(same goes for many others[[get]]
, etc). That's is why in this PR internal method with[[something]]
are renamed to__something__
. This makes it very clear that we are calling an internal method using the[[]]
syntax.Rename internal object methods:
set
=>__set__
get
=>__get__
Implement some spec functions:
CreateDataProperty()
CreateDataPropertyOrThrow()
Set
Get
HasProperty
IsExtensible
DeletePropertyOrThrow
DefineOwnProperty
The above methods help with implementing other builtin function and are used everywhere in the spec.
Documented/make spec compliant:
Object.prototype.toString
Object.prototype.assign
get RegExp.prototype.flags
Reflect.get
RegExp
abstract_builtin_exec
helper functionGcObject::to_property_descriptor
GcObject::get_method
Array.prototype.of
Array.prototype.push
Array.prototype.pop
Array.prototype.forEach
Array.prototype.join
Array.prototype.toString
Array.prototype.reverse
Array.prototype.shift
Array.prototype.unshift
Array.prototype.every
Array.prototype.some
Misc changes:
&self
instead of&mut self
(this avoids some clones).get_arg_at_index()
function inconsole
builtinFrom<u64>
toPropertyKey