Broken in Opera 11.64 #26

gaomd opened this Issue May 12, 2012 · 2 comments

3 participants


Just tested with a simple HTML file:

<!DOCTYPE html>
    <script type="text/javascript" src=""></script>


Uncaught exception: TypeError: Cannot convert 'global' to object

Error thrown at line 36, column 2 in <anonymous function>() in
    global.doT = doT;
called from line 7, column 0 in
    (function() {

Browser: Windows Opera 11.64 (latest version)
Related link:
But the minified version worked.


(0, eval) forces evaluation in the global scope, as it's an indirect call to eval. Unfortunately, Opera 11.6 incorrectly interprets (0 || eval) as a direct call—which causes evaluation to occur in the scope of the caller function.

The fix is to change line 29 to read like so:

var global = (function(){ return this || (0, eval)('this'); }());

The compressed version makes this change automatically, so that's why it works for you.

@olado olado closed this in e0adebb May 12, 2012

Thanks! (0 || eval) is slightly faster in v8 btw, but it does not matter here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment