Skip to content

Implement JSON object #168

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
wants to merge 1 commit into from
Closed

Implement JSON object #168

wants to merge 1 commit into from

Conversation

rtakacs
Copy link
Contributor

@rtakacs rtakacs commented Jun 10, 2015

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs [email protected]

@egavrin egavrin added ecma builtins Related to ECMA built-in routines development Feature implementation labels Jun 10, 2015
@egavrin egavrin added this to the ECMA builtins milestone Jun 10, 2015
@rtakacs rtakacs mentioned this pull request Jun 10, 2015
11 tasks
@zherczeg
Copy link
Member

Finally the pull request is here :) I am proud of the parse test I added. Since Jerry knows more, perhaps we should improve test coverage / test quality. Lately we stumbled several issues which could be revealed before by better test cases.

@@ -54,6 +54,9 @@ ECMA_MAGIC_STRING_DEF (ECMA_MAGIC_STRING_TYPE_ERROR_UL, "TypeError")
ECMA_MAGIC_STRING_DEF (ECMA_MAGIC_STRING_URI_ERROR_UL, "URIError")
ECMA_MAGIC_STRING_DEF (ECMA_MAGIC_STRING_MATH_UL, "Math")
ECMA_MAGIC_STRING_DEF (ECMA_MAGIC_STRING_JSON_U, "JSON")
ECMA_MAGIC_STRING_DEF (ECMA_MAGIC_STRING_STRINGIFY, "stringify")
ECMA_MAGIC_STRING_DEF (ECMA_MAGIC_STRING_PARSE, "parse")
ECMA_MAGIC_STRING_DEF (ECMA_MAGIC_STRING_TO_JSON, "toJSON")
Copy link
Contributor

Choose a reason for hiding this comment

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

/* Create 4 digits hex value. */
MEM_DEFINE_LOCAL_ARRAY (hex_buff, 5, ecma_char_t);

for (uint32_t i = 0; i < 4; i++)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should introduce helper function for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a bad idea, moved these into a helper function.

@egavrin egavrin added the critical Raises security concerns label Jun 23, 2015
@galpeter
Copy link
Contributor

I've got no other comments, lgtm

@galpeter galpeter removed their assignment Jun 26, 2015
* Returned value must be freed with ecma_deref_ecma_string.
*/
ecma_string_t *
ecma_builtin_helper_json_create_separated_properties (list_ctx_t *partial_p,
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing comments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@egavrin
Copy link
Contributor

egavrin commented Jun 26, 2015

Folks, I'd really like to merge this PR in the beginning of the week. Let's make the final review at monday.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs [email protected]
#include "ecma-helpers.h"
#include "ecma-builtin-helpers.h"

#define LIST_BLOCK_SIZE 256UL
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the block size is 256UL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a copy from the regexp engine. Maybe a bit big. :)

@zherczeg
Copy link
Member

zherczeg commented Jul 6, 2015

Since the project went on public, this is not updated automatically anymore.

@zherczeg
Copy link
Member

zherczeg commented Jul 6, 2015

New PR created: #307

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

Successfully merging this pull request may close these issues.

5 participants