diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2014-03-31 14:38:28 +0200 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2014-04-02 00:05:24 +0400 |
commit | 67e078094b53861a5aa7e9354e33487d0bd4f73b (patch) | |
tree | 09a706adee1ddb59c1507ee3320de9cb6896135b /deps/v8/test/mjsunit/string-oom-replace-global-regexp-with-string.js | |
parent | f984555d47298cfb01b3e55c2861066379306fc3 (diff) | |
download | node-new-67e078094b53861a5aa7e9354e33487d0bd4f73b.tar.gz |
deps: upgrade v8 to 3.25.30
Diffstat (limited to 'deps/v8/test/mjsunit/string-oom-replace-global-regexp-with-string.js')
-rw-r--r-- | deps/v8/test/mjsunit/string-oom-replace-global-regexp-with-string.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/string-oom-replace-global-regexp-with-string.js b/deps/v8/test/mjsunit/string-oom-replace-global-regexp-with-string.js new file mode 100644 index 0000000000..2de01109eb --- /dev/null +++ b/deps/v8/test/mjsunit/string-oom-replace-global-regexp-with-string.js @@ -0,0 +1,26 @@ +// Copyright 2014 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + + + +var a = 'a'; +for (var i = 0; i < 5; i++) a += a; +var b = 'b'; +for (var i = 0; i < 23; i++) b += b; + +function replace1() { + a.replace(/./g, b); +} + +assertThrows(replace1, RangeError); + + +var a = 'a'; +for (var i = 0; i < 16; i++) a += a; + +function replace2() { + a.replace(/a/g, a); +} + +assertThrows(replace2, RangeError); |