Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: test/intl/general/empty-handle.js

Issue 18687003: Import intl test suite from v8-i18n project (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698