Index: test/intl/general/empty-handle.js |
diff --git a/src/extensions/i18n/footer.js b/test/intl/general/empty-handle.js |
similarity index 73% |
copy from src/extensions/i18n/footer.js |
copy to test/intl/general/empty-handle.js |
index ac33f1e24224957ff05d2cddef072987dd96942d..009449e3506651621de94ff9f0e2f12f94e6bf1a 100644 |
--- a/src/extensions/i18n/footer.js |
+++ b/test/intl/general/empty-handle.js |
@@ -26,15 +26,24 @@ |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// limitations under the License. |
-// ECMAScript 402 API implementation is broken into separate files for |
-// each service. The build system combines them together into one |
-// Intl namespace. |
+// Minimal test case for b/161999. |
+// We have to check if ObjectTemplate::NewInstance returned empty handle, which |
+// can happen if there was a stack overflow. |
+// This test can take some time to fail. |
-// Fix RegExp global state so we don't fail WebKit layout test: |
-// fast/js/regexp-caching.html |
-// It seems that 'g' or test() operations leave state changed. |
-var CLEANUP_RE = new RegExp(''); |
-CLEANUP_RE.test(''); |
+var didThrowRangeError = false; |
+try { |
+ var X = '})()'; |
+ function C() { X[C("asd".localeCompare("asdf") < 0)] = C("a"); } |
+ var b = C(C(new Date(Number.b, "").getTime()), |
+ function() { |
+ if (!X.C()) { |
+ } |
+ }[0].b++); |
+} catch (e) { |
+ if (e instanceof RangeError) { |
+ didThrowRangeError = true; |
+ } |
+} |
-return Intl; |
-}()); |
+assertTrue(didThrowRangeError); |