Created
September 11, 2013 09:11
-
-
Save cgwyllie/6521189 to your computer and use it in GitHub Desktop.
Simple failing case for php-spidermonkey mozjs17 port
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$js = new JSContext(); | |
$js->registerFunction('var_dump', 'var_dump'); | |
$window = (object) [ | |
'foo' => function () { | |
print 'foo'; | |
} | |
]; | |
$js->assign('window', $window); | |
$script = <<<END | |
var_dump(typeof window.foo); | |
window.foo(); | |
END; | |
$js->evaluateScript($script); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment