Skip to content

Instantly share code, notes, and snippets.

@piscisaureus
Created June 25, 2012 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piscisaureus/86ebb3ed4674516bf442 to your computer and use it in GitHub Desktop.
Save piscisaureus/86ebb3ed4674516bf442 to your computer and use it in GitHub Desktop.
function crash(obj) {
return obj.foo;
}
function base(number_of_properties) {
var result = new Array();
for (var i = 0; i < number_of_properties; i++) {
result["property" + i] = "value" + i;
}
result.foo = number_of_properties;
return result;
}
var a = base(12);
var b = base(13);
var c = base(14);
var d = base(15);
crash(a);
crash(b);
crash(c);
crash(d); // Polymorphic, degree 4.
for (i = 0; i < 260; i++)
crash(a);
//Prepare ElementsKind transition map chain.
var x = base(13);
x[0] = "object";
x = base(14);
x[0] = "object";
x = base(15);
x[0] = "object";
console.log("almost");
setTimeout(function() {
crash(a);
console.log("done");
}, 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment