Remove English locale dependency for detecting some JS errors #4703
Labels
closed-duplicate
Closed in favor of an existing report
P0
A serious issue requiring immediate resolution
web-dart2js
Milestone
Right now in Dart2js we rely on several English JavaScript error messages to detect failure conditions for Dart compiled to JS. (Examples include "is null or undefined", " is not a function'", and "doesn't support property or method" (lines 807-810 in r11307). This will be a problem for users whose JS errors are printed in a language other than English. We need to come up with alternative error handling for errors in different languages.
Code mentioned: http://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/lib/compiler/implementation/lib/js_helper.dart
Suggestion: In lines 809-810, we know the error is a type error, can we know it's not a NullPointerException or a ObjectNotClosureException. Can we just always throw a NoSuchMethodException in that case instead of also testing if (message.contains(' is not a function') || message.contains("doesn't support property or method")) ?
The text was updated successfully, but these errors were encountered: