0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 18:41:52 +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 # insert unicode via executeString
$jscript->executeString("var execStr = {unicode: '" . $unicode . "'}"); $jscript->executeString("var execStr = {unicode: '" . $unicode . "'}");
# insert via module loader
$jscript->setModuleLoader(function ($path) use ($unicode) {
return "module.exports = {unicode: '" . $unicode . "'}";
});
# return to php # return to php
$jscript->executeString("values = {}"); $jscript->executeString("values = {}");
$jscript->executeString("values['snapshot'] = snapshot.unicode"); $jscript->executeString("values['snapshot'] = snapshot.unicode");
$jscript->executeString("values['php'] = php.unicode"); $jscript->executeString("values['php'] = php.unicode");
$jscript->executeString("values['execStr'] = execStr.unicode"); $jscript->executeString("values['execStr'] = execStr.unicode");
$jscript->executeString("values['module'] = require('module').unicode");
$values = $jscript->executeString("values"); $values = $jscript->executeString("values");
echo "snapshot: $values->snapshot\n"; echo "snapshot: $values->snapshot\n";
echo "php : $values->php\n"; echo "php : $values->php\n";
echo "execStr : $values->execStr\n"; echo "execStr : $values->execStr\n";
echo "module : $values->module\n";
?> ?>
===EOF=== ===EOF===
--EXPECT-- --EXPECT--
snapshot: äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃ snapshot: äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃
php : äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃ php : äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃
execStr : äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃ execStr : äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃
module : äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃
===EOF=== ===EOF===