0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 09:21:52 +00:00

test "delete module.exports"

This commit is contained in:
Stefan Siegl 2017-11-12 16:27:50 +01:00
parent 1c7e355937
commit 6a2f53a9f1
No known key found for this signature in database
GPG Key ID: 73942AF5642F3DDA

View File

@ -0,0 +1,27 @@
--TEST--
Test V8Js::setModuleLoader : delete module.exports yields undefined
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$v8 = new V8Js();
$v8->setModuleLoader(function ($moduleName) {
return <<<'EOJS'
delete module.exports;
EOJS
;
});
$v8->executeString(<<<'EOJS'
var result = require('foo');
var_dump(typeof result);
EOJS
);
?>
===EOF===
--EXPECT--
string(9) "undefined"
===EOF===