Update the test to ensure OutOfMemoryError is thrown as intended
[WebKit-https.git] / JSTests / stress / create-error-out-of-memory-rope-string.js
1 function assert(a, message) {
2     if (!a)
3         throw new Error(message);
4 }
5
6 try {
7     var foo = 'yy?x\uFFFD$w    5?\uFFFDo\uFFFD?\uFFFD\'i?\uFFFDE-N\uFFFD\uFFFD6_\uFFFD\\ d';
8     foo = foo.padEnd(2147483644, 1);
9     eval('foo()');
10     assert(false, `Should throw OOM error`);
11 } catch (error) {
12     assert(error.message == "Out of memory", "Expected OutOfMemoryError, but got: " + error);
13 }