| //@ runDefault("--useRandomizingFuzzerAgent=1", "--useConcurrentJIT=0") |
| function shouldEqual(testId, iteration, actual, expected) { |
| if (actual != expected) { |
| throw new Error("Test #" + testId + ", iteration " + iteration + ", ERROR: expected \"" + expected + "\", got \"" + actual + "\""); |
| function makeUnwriteableUnconfigurableObject() |
| return Object.defineProperty([], 0, {value: "frozen", writable: false, configurable: false}); |
| function testArrayOf(obj) |
| Array.of.call(function() { return obj; }, "no longer frozen"); |
| let numIterations = 10000; |
| function runTest(testId, test, sourceMaker, expectedException) { |
| for (var i = 0; i < numIterations; i++) { |
| var exception = "No exception"; |
| exception = exception.substr(0, 10); // Search for "TypeError:". |
| shouldEqual(testId, i, exception, expectedException); |
| runTest(1, testArrayOf, makeUnwriteableUnconfigurableObject, "TypeError:"); |