X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/2d39b0e377c0896910ee49ae70082ba665faf986..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/tests/stress/create-this-with-callee-variants.js diff --git a/tests/stress/create-this-with-callee-variants.js b/tests/stress/create-this-with-callee-variants.js new file mode 100644 index 0000000..a7368ae --- /dev/null +++ b/tests/stress/create-this-with-callee-variants.js @@ -0,0 +1,18 @@ +function createInLoop(x, count) { + noInline(x) + for (var i = 0; i < 5000; i++) { + var obj = new x; + if (!(obj instanceof x)) + throw "Failed to instantiate the right object"; + } +} + +function y() { return function () {} } + +createInLoop(y()); + +function z() { return function () {} } + +createInLoop(z()); +createInLoop(z()); +createInLoop(z());