mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fix assertion 'mem_pools == NULL' in the Date constructor.
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
This commit is contained in:
parent
fe475eace7
commit
144c3ba874
@ -172,6 +172,10 @@ ecma_date_construct_helper (const ecma_value_t *args, /**< arguments passed to t
|
||||
{
|
||||
ret_value = ecma_make_normal_completion_value (ecma_make_number_value (prim_value_p));
|
||||
}
|
||||
else
|
||||
{
|
||||
ecma_dealloc_number (prim_value_p);
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
} /* ecma_date_construct_helper */
|
||||
|
||||
@ -63,3 +63,22 @@ assert (d.valueOf() == 8.64e+15);
|
||||
|
||||
d = new Date(8.64e+15 + 1);
|
||||
assert (isNaN(d.valueOf()));
|
||||
|
||||
var Obj = function (val)
|
||||
{
|
||||
this.value = val;
|
||||
this.valueOf = function () { throw new ReferenceError ("valueOf-" + this.value); };
|
||||
this.toString = function () { throw new ReferenceError ("toString-"+ this.value); };
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
d = new Date (new Obj (1), new Obj (2));
|
||||
// Should not be reached.
|
||||
assert (false);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
assert (e instanceof ReferenceError);
|
||||
assert (e.message === "valueOf-1");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user