Skip to content

Empty values in array creation should be not set #319

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

Closed

Conversation

galpeter
Copy link
Contributor

@galpeter galpeter commented Jul 6, 2015

When creating arrays it is possible to set 'empty' values
which are not undefined, but simply unused values.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com

When creating arrays it is possible to set 'empty' values
which are not undefined, but simply unused values.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
@galpeter
Copy link
Contributor Author

galpeter commented Jul 6, 2015

@zherczeg
Copy link
Member

zherczeg commented Jul 7, 2015

+1 lgtm

@LaszloLango LaszloLango added bug Undesired behaviour ecma builtins Related to ECMA built-in routines labels Jul 7, 2015
@LaszloLango LaszloLango added this to the ECMA builtins milestone Jul 7, 2015
@ruben-ayrapetyan
Copy link
Contributor

I think, this should be fixed by modification of byte-code / opcode handlers, without introduction of a new simple value.

@ruben-ayrapetyan
Copy link
Contributor

Is there any issue opened for this?

@galpeter
Copy link
Contributor Author

@ruben-ayrapetyan , there is no issue opened for this. I'll create one.

I've got one question regarding the byte-code/opcode way: in the ecma_op_create_array_object method how would the 'unset' arguments appear? (Currently) In that function we need to know which indexes are set, and which are not.

@galpeter
Copy link
Contributor Author

Created issue: #356

@ruben-ayrapetyan
Copy link
Contributor

@galpeter, thank you!

ECMA-262 v5, 11.1.4 defines that array object should be created empty, and then filled, step by step. So, we don't need to pass 'unset' arguments to ecma_op_create_array_object.

@galpeter
Copy link
Contributor Author

So that means that we the ecma_op_create_array_object will be called with empty argument list and then the elements will be added one by one (via define prop or something like that). If so then we can close this PR.

@egavrin
Copy link
Contributor

egavrin commented Jul 10, 2015

@galpeter @ruben-ayrapetyan let's close this PR is everyone is OK to continue with #356.

@ruben-ayrapetyan
Copy link
Contributor

@galpeter, @egavrin, I agree that the pull request can be closed, as the issue is already described in #356 with reference to the pull request.

@egavrin
Copy link
Contributor

egavrin commented Jul 10, 2015

Ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behaviour ecma builtins Related to ECMA built-in routines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants