Fix two issues that broke minification on dart2js.

R=karlklose@google.com
BUG=

Review URL: https://codereview.chromium.org//11959030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17188 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
erikcorry@google.com 2013-01-17 10:31:55 +00:00
parent 9ee5fc4b53
commit 1af34e1710
2 changed files with 9 additions and 4 deletions

View file

@ -1872,7 +1872,7 @@ $lazyInitializerLogic
if (!compiler.codegenWorld.staticFunctionsNeedingGetter.contains(appMain)) {
Selector selector = new Selector.callClosure(0);
String invocationName = namer.invocationName(selector);
buffer.add("$mainAccess.$invocationName = $mainAccess");
buffer.add("$mainAccess.$invocationName = $mainAccess$N");
}
return "${namer.isolateAccess(isolateMain)}($mainAccess)";
}

View file

@ -892,10 +892,14 @@ $throw(ex) {
* Wrapper class for throwing exceptions.
*/
class DartError {
/// The Dart object (or primitive JavaScript value) which was thrown.
final 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(this.dartException) {
DartError(var dartException) {
JS('void', '#.dartException = #', this, dartException);
// Install a toString method that the JavaScript system will call
// to format uncaught exceptions.
JS('void', '#.toString = #', this, DART_CLOSURE_TO_JS(toStringWrapper));
@ -925,6 +929,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 {