Skip to content
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

Implement Object.create function #209

Closed
wants to merge 1 commit into from
Closed

Implement Object.create function #209

wants to merge 1 commit into from

Conversation

kkristof
Copy link
Contributor

JerryScript-DCO-1.0-Signed-off-by: Kristof Kosztyo kkosztyo.u-szeged@partner.samsung.com

@kkristof kkristof added ecma builtins Related to ECMA built-in routines development Feature implementation labels Jun 18, 2015
@kkristof kkristof added this to the ECMA builtins milestone Jun 18, 2015
@ILyoan ILyoan mentioned this pull request Jun 18, 2015
9 tasks
// is equivalent to:
var o2 = Object.create(Object.prototype);

//assert (o1 === o2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional?

@kkristof
Copy link
Contributor Author

Hi, I have updated the patch.

@@ -28,6 +28,7 @@

extern ecma_object_t* ecma_op_create_object_object_noarg (void);
extern ecma_completion_value_t ecma_op_create_object_object_arg (ecma_value_t value);
extern ecma_object_t* ecma_op_create_object_object_noarg_and_set_prototype (ecma_object_t *object_prototype_p);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please align the * to the function name.

@galpeter
Copy link
Contributor

aside from the minor style comments it looks good to me.

@@ -62,7 +62,7 @@ ecma_op_create_object_object_noarg (void)
ecma_object_t *object_prototype_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);

// 3., 4., 6., 7.
ecma_object_t *obj_p = ecma_create_object (object_prototype_p, true, ECMA_OBJECT_TYPE_GENERAL);
ecma_object_t *obj_p = ecma_op_create_object_object_noarg_and_set_prototype (object_prototype_p);

ecma_deref_object (object_prototype_p);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you, please, move the comment about [[Class]] below to ecma_op_create_object_object_noarg_and_set_prototype?

JerryScript-DCO-1.0-Signed-off-by: Kristof Kosztyo kkosztyo.u-szeged@partner.samsung.com
@kkristof
Copy link
Contributor Author

Hi, I have updated the patch.

@ruben-ayrapetyan
Copy link
Contributor

Looks good to me.

@egavrin
Copy link
Contributor

egavrin commented Jun 22, 2015

make push

@galpeter
Copy link
Contributor

Rebased & merged: 61ab205

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

Successfully merging this pull request may close these issues.

None yet

4 participants