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 String.prototype.match #443
Implement String.prototype.match #443
Conversation
ecma_op_to_string (this_arg), | ||
ret_value); | ||
|
||
ecma_value_t regexp_value = 0; |
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.
0
is not a valid value for ecma_value_t
.
Could you, please, change this to ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY)
and check below to !ecma_is_value_empty
?
Also, maybe, the initialization and check could be removed, as compiler checks for accessing uninitialized values.
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.
I did the initialization because the compiler gave me the warning that it found a case where it is not initialized when it gets to the 385 line.
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.
I see. Thanks for explanation.
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.
however, it's to that the use of the empty simple value would be better.
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.
I think so too. The update would be necessary, now or in future, when type checking for ecma-values would be improved.
b419eb6
to
1bc4638
Compare
PR updated. |
ecma_op_object_get (regexp_obj_p, global_string_p), | ||
ret_value); | ||
|
||
JERRY_ASSERT (ecma_is_completion_value_normal_true (global_value) |
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.
global_value
is not completion value. ecma_is_value_boolean
could be used in the case.
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.
darn, forgot that one
Added implementation for the String.prototype.match method. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
1bc4638
to
711efea
Compare
PR updated again :) |
Looks good to me |
lgtm |
Landed: 11c3103 |
Merged 11c3103 |
@egavrin, why is this reopened? |
@LaszloLango accident |
@egavrin, ok :) |
Added implementation for the String.prototype.match method.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com