Rework function call.#2414
Merged
yichoi merged 1 commit intojerryscript-project:masterfrom Jul 11, 2018
Merged
Conversation
Contributor
|
Please add a test for this. |
f80dd6a to
f4b2bea
Compare
Member
Author
|
Test case added. |
LaszloLango
requested changes
Jul 2, 2018
| static ecma_value_t | ||
| ecma_op_function_construct_simple_or_external (ecma_object_t *func_obj_p, /**< Function object */ | ||
| ecma_op_function_construct_ecma_or_external (ecma_object_t *func_obj_p, /**< Function object */ | ||
| const ecma_value_t *arguments_list_p, /**< arguments list */ |
rerobika
reviewed
Jul 10, 2018
| { | ||
| if (JERRY_UNLIKELY (ecma_get_object_is_builtin (func_obj_p))) | ||
| { | ||
| return ecma_builtin_dispatch_call (func_obj_p, |
Member
There was a problem hiding this comment.
Built-in function objects should never have a construct_flag, but it would be nice to see a JERRY_ASSERT (!ecma_op_function_has_construct_flag (arguments_list_p)) before returning with ecma_builtin_dispatch_call.
This case currently seems impossible but the assertion could prevent the wrong usage of the ecma_op_function_set_construct_flag in the future.
Furthermore add a construct flag, which disallows calling certain functions without new. Constructing bound arrow functions correctly throws error now. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
f4b2bea to
a59cf4f
Compare
Member
Author
|
Thank you for the comments, patch is updated. |
Member
|
LGTM (informally) |
yorkie
added a commit
to yodaos-project/ShadowNode
that referenced
this pull request
Oct 20, 2018
Furthermore add a construct flag, which disallows calling certain functions without new. Constructing bound arrow functions correctly throws error now. Author: Zoltan Herczeg<zherczeg.u-szeged@partner.samsung.com> PR-URL: jerryscript-project/jerryscript#2414
Merged
3 tasks
yorkie
added a commit
to yodaos-project/ShadowNode
that referenced
this pull request
Oct 23, 2018
Furthermore add a construct flag, which disallows calling certain functions without new. Constructing bound arrow functions correctly throws error now. Author: Zoltan Herczeg<zherczeg.u-szeged@partner.samsung.com> PR-URL: jerryscript-project/jerryscript#2414
yorkie
added a commit
to yodaos-project/ShadowNode
that referenced
this pull request
Oct 24, 2018
Furthermore add a construct flag, which disallows calling certain functions without new. Constructing bound arrow functions correctly throws error now. Author: Zoltan Herczeg<zherczeg.u-szeged@partner.samsung.com> PR-URL: jerryscript-project/jerryscript#2414
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Furthermore add a construct flag, which disallows calling certain functions without new. Constructing bound arrow functions correctly throws error now.
It seems the change has close to no effect:
Binary: 50 byte reduction, perf: -0.004%, mem: 0.000%