Fix of memory leak in Function.prototype.bind function.

Related issue: #511

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
This commit is contained in:
Zsolt Borbély
2015-08-03 15:17:33 +02:00
parent 2630048ecc
commit e61f41a0bc
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -801,8 +801,13 @@ ecma_free_internal_property (ecma_property_t *property_p) /**< the property */
case ECMA_INTERNAL_PROPERTY_NON_INSTANTIATED_BUILT_IN_MASK_0_31: /* an integer (bit-mask) */
case ECMA_INTERNAL_PROPERTY_NON_INSTANTIATED_BUILT_IN_MASK_32_63: /* an integer (bit-mask) */
case ECMA_INTERNAL_PROPERTY_BOUND_FUNCTION_TARGET_FUNCTION:
{
break;
}
case ECMA_INTERNAL_PROPERTY_BOUND_FUNCTION_BOUND_THIS:
{
ecma_free_value (property_value, false);
break;
}
+3
View File
@@ -115,6 +115,9 @@ assert (foo == 3);
assert (foo instanceof Number);
assert (foo.prototype === undefined);
var func = Number.prototype.toString.bind('foo');
assert (func instanceof Function);
try {
var this_obj = this.constructor;
var bound = this_obj.bind(null, "foo");