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

Unified Diff: test/browser/runtime_tests.js

Issue 1601353002: partial fix for #414, nSM message for dcall should show correct target (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « lib/runtime/dart/_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 030be22ac847fd6c3fb4f1d582bd22cd29b16f13..7e3538e9c72ebe6408439209bbcfa23de7161784 100644
--- a/test/browser/runtime_tests.js
+++ b/test/browser/runtime_tests.js
@@ -24,6 +24,20 @@ suite('generic', () => {
assert.throws(() => { generic(function(){}); });
});
+ test('dcall noSuchMethod has correct error target', () => {
+ assert.throws(() => dart.dcall(42),
+ new RegExp('NoSuchMethodError.*\nReceiver: 42', 'm'),
+ 'Calls with non-function receiver should throw a NoSuchMethodError' +
+ ' with correct target');
+
+ // TODO(jmesserly): we should show the name "print" in there somewhere.
+ assert.throws(() => dart.dcall(core.print, 1, 2, 3),
+ new RegExp('NoSuchMethodError.*\n' +
+ "Receiver: Instance of '\\(Object\\) -> void'", 'm'),
+ 'Calls with incorrect argument types should throw a NoSuchMethodError' +
+ ' with correct target');
+ });
+
test('can throw number', () => {
try {
dart.throw(42);
« no previous file with comments | « lib/runtime/dart/_operations.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698