Index: lib/runtime/dart/core.js |
diff --git a/lib/runtime/dart/core.js b/lib/runtime/dart/core.js |
index 1633425ebb865fe622087e816207f09cce6a99d7..89b755c08d3c56957656a59765dbc4fea9ce0b60 100644 |
--- a/lib/runtime/dart/core.js |
+++ b/lib/runtime/dart/core.js |
@@ -1501,7 +1501,25 @@ dart_library.library('dart/core', null, /* Imports */[ |
return Sink; |
}); |
let Sink = Sink$(); |
- class StackTrace extends Object {} |
+ class StackTrace extends Object { |
+ static get current() { |
+ let error = new Error(); |
+ let stack = error.stack; |
+ if (typeof stack == 'string') return new StackTrace.fromString(stack); |
+ if (Error.captureStackTrace != null) { |
+ Error.captureStackTrace(error); |
+ let stack = error.stack; |
+ if (typeof stack == 'string') return new StackTrace.fromString(stack); |
+ } |
+ try { |
+ dart.throw(0); |
+ } catch (_) { |
+ let stackTrace = dart.stackTrace(_); |
+ return stackTrace; |
+ } |
+ |
+ } |
+ } |
const _stop = dart.JsSymbol('_stop'); |
class Stopwatch extends Object { |
get frequency() { |