-
-
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
[Merged by Bors] - Set function names in object literal methods #2460
Conversation
Test262 conformance changes
Fixed tests (24):
|
Codecov Report
@@ Coverage Diff @@
## main #2460 +/- ##
==========================================
+ Coverage 51.04% 52.01% +0.97%
==========================================
Files 346 343 -3
Lines 35846 35295 -551
==========================================
+ Hits 18297 18359 +62
+ Misses 17549 16936 -613
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small nitpicks, everything else looks perfect.
boa_engine/src/vm/code_block.rs
Outdated
@@ -177,7 +177,7 @@ impl CodeBlock { | |||
let opcode: Opcode = self.code[*pc].try_into().expect("invalid opcode"); | |||
*pc += size_of::<Opcode>(); | |||
match opcode { | |||
Opcode::RotateLeft | Opcode::RotateRight => { | |||
Opcode::RotateLeft | Opcode::RotateRight | Opcode::SetFunctionName => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opcode::RotateLeft | Opcode::RotateRight | Opcode::SetFunctionName => { | |
Opcode::SetFunctionName => { | |
let operand = self.read::<u8>(*pc); | |
*pc += size_of::<u8>(); | |
match operand { | |
0 => "prefix: none", | |
1 => "prefix: get", | |
2 => "prefix: set", | |
} | |
} | |
Opcode::RotateLeft | Opcode::RotateRight => { |
I think it would be good to print the prefix, instead of a number
boa_engine/src/vm/flowgraph/mod.rs
Outdated
@@ -45,7 +45,7 @@ impl CodeBlock { | |||
|
|||
pc += size_of::<Opcode>(); | |||
match opcode { | |||
Opcode::RotateLeft | Opcode::RotateRight => { | |||
Opcode::RotateLeft | Opcode::RotateRight | Opcode::SetFunctionName => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
Maybe making it a static method of SetFunctionName
struct to avoid code duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Thanks!
let value = AssignmentExpression::new(None, true, self.allow_yield, self.allow_await) | ||
let name = property_name | ||
.literal() | ||
.filter(|name| name != &Sym::__PROTO__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Sym
is Copy
, I would suggest to either dereference name
, or use copied()
:
.filter(|name| name != &Sym::__PROTO__) | |
.filter(|name| *name != Sym::__PROTO__) |
Even though I guess it's equivalent, it more clearly shows intent of comparing the symbol value, and not the reference.
bors r+ |
This Pull Request changes the following: - Implement `SetFunctionName` opcode based on [`SetFunctionName`](https://tc39.es/ecma262/#sec-setfunctionname)
Pull request successfully merged into main. Build succeeded: |
This Pull Request changes the following:
SetFunctionName
opcode based onSetFunctionName