Skip to content

Commit dc997e3

Browse files
committed
resolves #58 check that Opal is not already defined on the global object
1 parent 9bfa3f5 commit dc997e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/opal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
if (!('log' in console)) { console.log = function () {}; }
3232
if (!('warn' in console)) { console.warn = console.log; }
3333

34-
if (typeof(this.Opal) !== 'undefined') {
34+
if (typeof(global_object.Opal) !== 'undefined') {
3535
console.warn('Opal already loaded. Loading twice can cause troubles, please fix your setup.');
36-
return this.Opal;
36+
return global_object.Opal;
3737
}
3838

3939
var nil;

0 commit comments

Comments
 (0)