Repository navigation
implement "this" - #320
implement "this"#320
Conversation
Benchmark for cc1a196Click to view benchmark
|
|
Hmmm I will give this a look during the weekend and see if I find out how it can be done :) |
|
This should no longer be blocked on function objects. About the environment trait, for now, I think this is good, but we might want to have multiple traits, depending on what should each environment have. For example, a global environment shouldn't have a parent environment, so it doesn't need to implement that function (and we avoid the |
464e0b1 to
8b32522
Compare
* get_this_binding() was wrong, fixed * BindingStatus is now properly set * `this` now works on dynamic functions
|
This is ready for review, @Razican clippy is moaning about https://github.com/jasonwilliams/boa/pull/320/files#diff-d7bd296d9ca534161e198b8c141ca51fR611 im not sure what to do about it. |
Benchmark for 43a9df7Click to view benchmark
|
Let me check this tomorrow or on Friday :) |
| /// Utility to create a function Value for Function Declarations, Arrow Functions or Function Expressions | ||
| pub(crate) fn create_function( | ||
| &mut self, | ||
| args: &Box<[FormalParameter]>, |
There was a problem hiding this comment.
So, we have two options here. Either we receive a Box<[FormalParameter]> or a &[FormalParameter]. If you take a Box, you can directly pass it to FunctionObject::create_ordinary and this would probably reflect better how the function works internally, but you would need to clone it on call.
If this is not possible, you can just receive a &[FormalParameter] and then do a to_vec().into_boxed_slice(), or something like that.
There was a problem hiding this comment.
Thanks, will try both options later
Benchmark for f9b7032Click to view benchmark
|
Fixes jasonwilliams#264
Fixes jasonwilliams#360