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

Unified Diff: lib/compiler/implementation/lib/js_helper.dart

Issue 10836327: Broaden NSME check (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/js_helper.dart
diff --git a/lib/compiler/implementation/lib/js_helper.dart b/lib/compiler/implementation/lib/js_helper.dart
index 7fe30c955972365a8b45593551be418836ff75a0..b969c9d4e621241ded0e0b8e6ca8b7b19023fd1e 100644
--- a/lib/compiler/implementation/lib/js_helper.dart
+++ b/lib/compiler/implementation/lib/js_helper.dart
@@ -815,7 +815,9 @@ unwrapException(ex) {
message.endsWith('is undefined') ||
message.endsWith('is null or undefined')) {
return new NullPointerException();
- } else if (message.endsWith('is not a function')) {
+ } else if (message.contains(' is not a function')) {
+ // x.foo is not a function
+ // 'undefined' is not a function (evaluating 'x.foo(1,2,3)')
// TODO(kasperl): Compute the right name if possible.
return new NoSuchMethodException('', '<unknown>', []);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698