mirror of
https://github.com/dart-lang/sdk
synced 2024-10-05 03:15:01 +00:00
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:
parent
9ee5fc4b53
commit
1af34e1710
|
@ -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)";
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue