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>[ ...@@ -33,9 +33,9 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[
number: -1, number: -1,
packageScheme: 'package', packageScheme: 'package',
package: 'web_integration', package: 'web_integration',
packagePath: 'stack_trace.dart.lib.js', packagePath: 'stack_trace.dart',
line: 138, line: 121,
column: 15, column: 3,
className: '<unknown>', className: '<unknown>',
method: 'baz', method: 'baz',
source: '', source: '',
...@@ -44,9 +44,9 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[ ...@@ -44,9 +44,9 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[
number: -1, number: -1,
packageScheme: 'package', packageScheme: 'package',
package: 'web_integration', package: 'web_integration',
packagePath: 'stack_trace.dart.lib.js', packagePath: 'stack_trace.dart',
line: 135, line: 116,
column: 17, column: 3,
className: '<unknown>', className: '<unknown>',
method: 'bar', method: 'bar',
source: '', source: '',
...@@ -55,9 +55,9 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[ ...@@ -55,9 +55,9 @@ const List<StackFrame> expectedDebugStackFrames = <StackFrame>[
number: -1, number: -1,
packageScheme: 'package', packageScheme: 'package',
package: 'web_integration', package: 'web_integration',
packagePath: 'stack_trace.dart.lib.js', packagePath: 'stack_trace.dart',
line: 132, line: 111,
column: 17, column: 3,
className: '<unknown>', className: '<unknown>',
method: 'foo', method: 'foo',
source: '', source: '',
......
...@@ -194,7 +194,17 @@ define("main_module.bootstrap", ["$entrypoint", "dart_sdk"], function(app, dart_ ...@@ -194,7 +194,17 @@ define("main_module.bootstrap", ["$entrypoint", "dart_sdk"], function(app, dart_
function(url) { function(url) {
url = url.replace(baseUrl, '/'); url = url.replace(baseUrl, '/');
var module = window.\$dartLoader.urlToModuleId.get(url); 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); 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