0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-11-09 16:28:41 +00:00

re-add module focused unicode test

This commit is contained in:
Stefan Siegl 2017-09-25 15:08:23 +02:00
parent d6561fe7dc
commit 289e382e63
No known key found for this signature in database
GPG Key ID: 51575950154839CD

View File

@ -20,20 +20,31 @@ $jscript->unicode = $unicode;
# insert unicode via executeString
$jscript->executeString("var execStr = {unicode: '" . $unicode . "'}");
# insert via module loader
$jscript->setModuleLoader(function ($path) use ($unicode) {
return "module.exports = {unicode: '" . $unicode . "'}";
});
# return to php
$jscript->executeString("values = {}");
$jscript->executeString("values['snapshot'] = snapshot.unicode");
$jscript->executeString("values['php'] = php.unicode");
$jscript->executeString("values['execStr'] = execStr.unicode");
$jscript->executeString("values['module'] = require('module').unicode");
$values = $jscript->executeString("values");
echo "snapshot: $values->snapshot\n";
echo "php : $values->php\n";
echo "execStr : $values->execStr\n";
echo "module : $values->module\n";
?>
===EOF===
--EXPECT--
snapshot: äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃
php : äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃
execStr : äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃
module : äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃
===EOF===