Title: [243265] trunk/JSTests
Revision
243265
Author
[email protected]
Date
2019-03-20 17:27:58 -0700 (Wed, 20 Mar 2019)

Log Message

Update the test to ensure OutOfMemoryError is thrown as intended
https://bugs.webkit.org/show_bug.cgi?id=196032
<rdar://problem/46842740>

Rubber stamped by Saam Barati.

* stress/create-error-out-of-memory-rope-string.js:
(assert):
(catch):

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (243264 => 243265)


--- trunk/JSTests/ChangeLog	2019-03-21 00:22:06 UTC (rev 243264)
+++ trunk/JSTests/ChangeLog	2019-03-21 00:27:58 UTC (rev 243265)
@@ -1,3 +1,15 @@
+2019-03-20  Yusuke Suzuki  <[email protected]>
+
+        Update the test to ensure OutOfMemoryError is thrown as intended
+        https://bugs.webkit.org/show_bug.cgi?id=196032
+        <rdar://problem/46842740>
+
+        Rubber stamped by Saam Barati.
+
+        * stress/create-error-out-of-memory-rope-string.js:
+        (assert):
+        (catch):
+
 2019-03-20  Tadeu Zagallo  <[email protected]>
 
         JSC::createError needs to check for OOM in errorDescriptionForValue

Modified: trunk/JSTests/stress/create-error-out-of-memory-rope-string.js (243264 => 243265)


--- trunk/JSTests/stress/create-error-out-of-memory-rope-string.js	2019-03-21 00:22:06 UTC (rev 243264)
+++ trunk/JSTests/stress/create-error-out-of-memory-rope-string.js	2019-03-21 00:27:58 UTC (rev 243265)
@@ -1,3 +1,13 @@
-var foo = 'yy?x\uFFFD$w    5?\uFFFDo\uFFFD?\uFFFD\'i?\uFFFDE-N\uFFFD\uFFFD6_\uFFFD\\ d';
-foo = foo.padEnd(2147483644, 1);
-eval('foo()');
+function assert(a, message) {
+    if (!a)
+        throw new Error(message);
+}
+
+try {
+    var foo = 'yy?x\uFFFD$w    5?\uFFFDo\uFFFD?\uFFFD\'i?\uFFFDE-N\uFFFD\uFFFD6_\uFFFD\\ d';
+    foo = foo.padEnd(2147483644, 1);
+    eval('foo()');
+    assert(false, `Should throw OOM error`);
+} catch (error) {
+    assert(error.message == "Out of memory", "Expected OutOfMemoryError, but got: " + error);
+}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to