Skip to content

Instantly share code, notes, and snippets.

@Constellation
Created September 21, 2018 13:38
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 Constellation/03091c4e6310b2afd481cea621240b66 to your computer and use it in GitHub Desktop.
Save Constellation/03091c4e6310b2afd481cea621240b66 to your computer and use it in GitHub Desktop.
test.js
function test(string) { return string.length; }
noInline(test);
function check(value, expected) { if (value !== expected) throw new Error("out"); }
noInline(check);
for (var i = 0; i < 1e6; ++i)
check(test("Hello"), 5);
var obj = { length: 42 };
for (var i = 0; i < 1e6; ++i) {
check(test("Hello"), 5);
check(test(obj), 42);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment