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

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

Issue 11959030: Fix two issues that broke minification on dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
index 67e59fb1ac5726e4a22ec604be93a9954c7e94ff..571a86779da773f372a0b60963acb702a0a92be0 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
@@ -898,10 +898,14 @@ $throw(ex) {
* Wrapper class for throwing exceptions.
*/
class DartError {
- /// The Dart object (or primitive JavaScript value) which was thrown.
- final dartException;
-
- DartError(this.dartException) {
+ /// The Dart object (or primitive JavaScript value) which was thrown is
+ /// attached to this object as a field named 'dartException'. We do this
+ /// only in raw JS so that we can use the 'in' operator and so that the
+ /// minifier does not rename the field. Therefore it is not declared as a
+ /// real field.
+
+ DartError(var dartException) {
+ JS('void', '#.dartException = #', this, dartException);
ahe 2013/02/13 12:54:07 Sorry about that, I didn't think too carefully abo
// Install a toString method that the JavaScript system will call
// to format uncaught exceptions.
JS('void', '#.toString = #', this, DART_CLOSURE_TO_JS(toStringWrapper));
@@ -931,6 +935,7 @@ class DartError {
// trace and Chrome even applies source maps to the stack
// trace. Remeber, this method is only ever invoked by the browser
// when an uncaught exception occurs.
+ var dartException = JS('var', r'#.dartException', this);
if (JS('bool', '!!Error.captureStackTrace') || (stack == null)) {
return dartException.toString();
} else {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698