Skip to content

Rework jerry_parse function.#2282

Merged
zherczeg merged 1 commit intojerryscript-project:masterfrom
zherczeg:jerry_parse_api
Apr 17, 2018
Merged

Rework jerry_parse function.#2282
zherczeg merged 1 commit intojerryscript-project:masterfrom
zherczeg:jerry_parse_api

Conversation

@zherczeg
Copy link
Copy Markdown
Member

Remove jerry_parse_named_resource, merge its arguments to jerry_parse and change is_strict argument to an option list for possible future extensions.

@zherczeg zherczeg mentioned this pull request Apr 16, 2018
typedef enum
{
JERRY_PARSE_STRICT_MODE = (1 << 0), /**< enable strict mode */
} jerry_parse_opts_t;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what about this?

typedef enum
{
  JERRY_PARSE_EMPTY = 0, /**< no flags */
  JERRY_PARSE_STRICT_MODE = (1 << 0), /**< enable strict mode */
} jerry_parse_flag_t;

So it will be similar to jerry_init_flag_t.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I want to phase out the flag term from the project. The option bits are much better description.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

(You can also see that in the snapshot gen/exec flags already landed).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And what about adding JERRY_PARSE_EMPTY or JERRY_PARSE_NO_OPTIONS? We should avoid using of literals in call sites of jerry_parse.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good idea. NO_OPTS added. I can rename it to NO_OPTIONS if you want.

Remove jerry_parse_named_resource, merge its arguments to jerry_parse
and change is_strict argument to an option list for possible future extensions.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Copy link
Copy Markdown
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@robertsipka robertsipka left a comment

Choose a reason for hiding this comment

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

LGTM

@zherczeg zherczeg merged commit 96b528a into jerryscript-project:master Apr 17, 2018
@zherczeg zherczeg deleted the jerry_parse_api branch April 17, 2018 07:51
jimmy-huang pushed a commit to jimmy-huang/jerryscript that referenced this pull request May 8, 2018
Remove jerry_parse_named_resource, merge its arguments to jerry_parse
and change is_strict argument to an option list for possible future extensions.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
@rerobika rerobika mentioned this pull request Jul 20, 2018
legendecas added a commit to yodaos-project/ShadowNode that referenced this pull request Nov 25, 2018
legendecas added a commit to yodaos-project/ShadowNode that referenced this pull request Nov 25, 2018
yorkie pushed a commit to yodaos-project/ShadowNode that referenced this pull request Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants