Skip to content

Commit

Permalink
Fix dart2js/sourcemaps/minified_names_test
Browse files Browse the repository at this point in the history
TBR=sigmund@google.com

Change-Id: Ie48333f2bfa9352c7ff787acc00dc12aa5c97cd5
Reviewed-on: https://dart-review.googlesource.com/68846
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
  • Loading branch information
rakudrama committed Aug 8, 2018
1 parent 8c059e7 commit 4196c0e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/compiler/dart2js/sourcemaps/minified_names_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ checkExpectation(MinifiedNameTest test, bool minified) async {
print(' obfuscated-name: $name');
Expect.isNotNull(name, 'Error didn\'t contain a name\nerror: $error');

if (name.startsWith('minified:')) {
name = name.substring(9);
}

var sourceMap = '${result.outputPath}.map';
var json = jsonDecode(await new File(sourceMap).readAsString());

Expand All @@ -119,7 +123,7 @@ checkExpectation(MinifiedNameTest test, bool minified) async {
var actualName;
if (test.isGlobal) {
var index = minifiedNames['global'][name];
Expect.isNotNull(index);
Expect.isNotNull(index, "'$name' not in global name map");
actualName = json['names'][index];
} else if (test.isInstance) {
var index = minifiedNames['instance'][name];
Expand Down

0 comments on commit 4196c0e

Please sign in to comment.