-
Notifications
You must be signed in to change notification settings - Fork 676
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
Conversation
// is equivalent to: | ||
var o2 = Object.create(Object.prototype); | ||
|
||
//assert (o1 === o2); |
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.
Is this intentional?
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); |
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.
Please align the *
to the function name.
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); | |||
|
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.
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 [email protected]
Hi, I have updated the patch. |
Looks good to me. |
|
Rebased & merged: 61ab205 |
JerryScript-DCO-1.0-Signed-off-by: Kristof Kosztyo [email protected]