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

Unified Diff: test/browser/runtime_tests.js

Issue 1245023004: fixes dart.throw to work for non-objects (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 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
« lib/runtime/_operations.js ('K') | « lib/runtime/_operations.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/browser/runtime_tests.js
diff --git a/test/browser/runtime_tests.js b/test/browser/runtime_tests.js
index 09f20c325aa4f867f2f56d2b43a885f9d92c3bbb..c320ca1d9817a5a01994305435634bd38408b5aa 100644
--- a/test/browser/runtime_tests.js
+++ b/test/browser/runtime_tests.js
@@ -23,6 +23,14 @@ suite('generic', () => {
assert.throws(() => { generic(function(){}); });
});
+ test('can throw number', () => {
+ try {
+ dart.throw(42);
+ } catch (e) {
+ assert.equal(e, 42);
+ }
+ });
+
test('argument count cannot change', () => {
let SomeType = generic(function(x) { return {x: x}; });
assert.throws(() => { SomeType(1,2) });
« lib/runtime/_operations.js ('K') | « lib/runtime/_operations.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698