mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 17:31:53 +00:00
Merge pull request #318 from stesie/issue-316
don't clean properties hash if it is iterated
This commit is contained in:
commit
4af1cca248
19
tests/issue_316_basic.phpt
Normal file
19
tests/issue_316_basic.phpt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
--TEST--
|
||||||
|
Test V8::executeString() : Issue #316 endless property iteration
|
||||||
|
--SKIPIF--
|
||||||
|
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$v8 = new V8Js();
|
||||||
|
|
||||||
|
$values = $v8->executeString('({test: "test"})');
|
||||||
|
foreach ($values as $value) {
|
||||||
|
var_dump($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
===EOF===
|
||||||
|
--EXPECT--
|
||||||
|
string(4) "test"
|
||||||
|
===EOF===
|
@ -224,7 +224,7 @@ static HashTable *v8js_v8object_get_properties(zval *object) /* {{{ */
|
|||||||
* it (instead of crashing the engine). */
|
* it (instead of crashing the engine). */
|
||||||
return obj->properties;
|
return obj->properties;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (!obj->properties->u.v.nIteratorsCount) {
|
||||||
zend_hash_clean(obj->properties);
|
zend_hash_clean(obj->properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user