Skip to content

Conversation

@jiangzidong
Copy link
Contributor

  • free_value after ecma_op_to_number
  • add a related test file

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com

if (arguments_list_len > 0)
{
ecma_number_t num = ecma_get_number_from_value (ecma_op_to_number (arguments_list_p[0]));
ecma_value_t num_value = ecma_op_to_number (arguments_list_p[0]);
Copy link
Member

Choose a reason for hiding this comment

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

This can also be a conversion exception.


try
{
var a = new ArrayBuffer(5.5);
Copy link
Member

Choose a reason for hiding this comment

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

There should be another case with:

var a = new ArrayBuffer("a string");

Or something non-number.

Copy link
Member

@zherczeg zherczeg left a comment

Choose a reason for hiding this comment

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

After the minor style fix, LGTM.

{
ecma_number_t num = ecma_get_number_from_value (ecma_op_to_number (arguments_list_p[0]));
ecma_value_t ret = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
ECMA_OP_TO_NUMBER_TRY_CATCH (num, arguments_list_p[0], ret);
Copy link
Member

Choose a reason for hiding this comment

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

Please put a newline before ECMA_OP_TO_NUMBER_TRY_CATCH.

Copy link
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

@zherczeg
Copy link
Member

zherczeg commented Dec 9, 2016

Excellent patch!

@zherczeg zherczeg merged commit 551aaa5 into jerryscript-project:master Dec 9, 2016
@zherczeg
Copy link
Member

zherczeg commented Dec 9, 2016

I hope you don't mind that I changed the patch description a bit. But please be a bit more verbose in the future.

* free_value after ecma_op_to_number
* add related test file

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
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