Unverified Commit 67362ce5 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] fix debug stack traces (#50872)

parent 57acc687
......@@ -33,9 +33,9 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[
number: -1,
packageScheme: 'package',
package: 'web_integration',
packagePath: 'stack_trace.dart.lib.js',
line: 138,
column: 15,
packagePath: 'stack_trace.dart',
line: 121,
column: 3,
className: '<unknown>',
method: 'baz',
source: '',
......@@ -44,9 +44,9 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[
number: -1,
packageScheme: 'package',
package: 'web_integration',
packagePath: 'stack_trace.dart.lib.js',
line: 135,
column: 17,
packagePath: 'stack_trace.dart',
line: 116,
column: 3,
className: '<unknown>',
method: 'bar',
source: '',
......@@ -55,9 +55,9 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[
number: -1,
packageScheme: 'package',
package: 'web_integration',
packagePath: 'stack_trace.dart.lib.js',
line: 132,
column: 17,
packagePath: 'stack_trace.dart',
line: 111,
column: 3,
className: '<unknown>',
method: 'foo',
source: '',
......
......@@ -194,7 +194,17 @@ define("main_module.bootstrap", ["$entrypoint", "dart_sdk"], function(app, dart_
function(url) {
url = url.replace(baseUrl, '/');
var module = window.\$dartLoader.urlToModuleId.get(url);
if (!module) return null;
if (!module) {
if (url.endsWith('dart_sdk.js')) {
module = 'dart_sdk';
} else {
try {
module = '/packages' + url.split('packages')[1].split('.')[0] + '.dart';
} catch (e) {
return null;
}
}
}
return dart.getSourceMap(module);
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment