Skip to content

Commit

Permalink
Version 3.3.0-274.0.dev
Browse files Browse the repository at this point in the history
Merge 29d52e6 into dev
  • Loading branch information
Dart CI committed Jan 2, 2024
2 parents 54ae194 + 29d52e6 commit 014514e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions pkg/dart2wasm/lib/functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ class FunctionCollector {
return _getFunctionTypeAndName(target, (ftype, name) => ftype);
}

/// Pass the Wasm type and name of the function for [target] to [action].
///
/// Name should be used for the Wasm names section entry for the function so
/// that the error stack traces will have names expected by the Dart spec.
T _getFunctionTypeAndName<T>(
Reference target, T Function(w.FunctionType, String) action) {
if (target.isTypeCheckerReference) {
Expand All @@ -162,13 +166,20 @@ class FunctionCollector {
Member member = target.asMember;
final ftype = member.accept1(_FunctionTypeGenerator(translator), target);

String memberName = member.toString();
if (memberName.endsWith('.')) {
memberName = memberName.substring(0, memberName.length - 1);
}

if (target.isInitializerReference) {
return action(ftype, '${member} initializer');
return action(ftype, 'new $memberName (initializer)');
} else if (target.isConstructorBodyReference) {
return action(ftype, '${member} constructor body');
return action(ftype, 'new $memberName (constructor body)');
} else if (member is Procedure && member.isFactory) {
return action(ftype, 'new $memberName');
} else {
return action(ftype, memberName);
}

return action(ftype, "${target.asMember}");
}

void activateSelector(SelectorInfo selector) {
Expand Down
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 3
MINOR 3
PATCH 0
PRERELEASE 273
PRERELEASE 274
PRERELEASE_PATCH 0

0 comments on commit 014514e

Please sign in to comment.