Skip to content

Instantly share code, notes, and snippets.

@hzr
hzr / gist:3340118
Created August 13, 2012 12:18
Opera JIT bug
function test() {
function testApply() {
function f(a) { return function() { return a.apply(this, arguments); }}
var g1 = f(function(){ this.x = 2; return {y: 3}; });
for (var i = 0; i < 50; i++) {
if ((new g1(2)).x !== undefined)
throw Error();
}
}
@hzr
hzr / gist:3183910
Created July 26, 2012 19:15
Check for Opera bug with nested redirected calls
var hasWorkingNestedRedirectedCalls = (function () {
function f(a) { return function() { return a.apply(this, arguments); }}
var g1 = f(function(a) { return a; });
var g2 = new g1(g1);
return typeof g2 == "function";
})();
@hzr
hzr / disable-jquery-lazyload.js
Created September 2, 2011 14:32
Disable stupid lazy loading of images
window.opera.addEventListener("AfterScript", function(e) {
if (typeof jQuery != "undefined" && jQuery.prototype.lazyload) {
jQuery.prototype.lazyload = function() {};
}
}, false);