mirror of
https://github.com/phpv8/v8js.git
synced 2024-11-14 17:38:42 +00:00
28 lines
451 B
Plaintext
28 lines
451 B
Plaintext
|
--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===
|