Skip to content

Instantly share code, notes, and snippets.

@cgwyllie
Created September 11, 2013 09:11
Show Gist options
  • Save cgwyllie/6521189 to your computer and use it in GitHub Desktop.
Save cgwyllie/6521189 to your computer and use it in GitHub Desktop.
Simple failing case for php-spidermonkey mozjs17 port
<?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