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

Unified Diff: test/mjsunit/es6/symbols.js

Issue 1489323002: [builtins] Remove some (now) unused code from C++ builtin adaptor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address feedback. Created 5 years 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
« no previous file with comments | « src/x87/builtins-x87.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/symbols.js
diff --git a/test/mjsunit/es6/symbols.js b/test/mjsunit/es6/symbols.js
index 58142cf27f04be74707acda6840a2ca8f9305eea..d071cbc01a2bd4280a5507c818451202e7a42c83 100644
--- a/test/mjsunit/es6/symbols.js
+++ b/test/mjsunit/es6/symbols.js
@@ -526,3 +526,26 @@ function TestComparison() {
}
}
TestComparison();
+
+
+// Make sure that throws occur in the context of the Symbol function.
+function TestContext() {
+ var r = Realm.create();
+ var rSymbol = Realm.eval(r, "Symbol");
+ var rError = Realm.eval(r, "TypeError");
+
+ function verifier(symbol, error) {
+ try {
+ new symbol();
+ } catch(e) {
+ return e.__proto__ === error.__proto__;
+ }
+ assertTrue(false); // should never get here.
+ }
+
+ assertTrue(verifier(Symbol, TypeError()));
+ assertTrue(verifier(rSymbol, rError()));
+ assertFalse(verifier(Symbol, rError()));
+ assertFalse(verifier(rSymbol, TypeError()));
+}
+TestContext();
« no previous file with comments | « src/x87/builtins-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698