| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
/// The URI for 'package:meta/dart2js.dart'.```suggestion
/// The URI for 'package:meta/meta.dart'.
```
Iterable<PragmaAnnotationData> pragmaAnnotation = _getPragmaAnnotation(This should be named differently if it's now a collection. Or consider inlining it below.
Iterable<PragmaAnnotationData> _getPragmaAnnotation(ir.Constant constant) {This ought to be renamed too.
if (constant is! ir.InstanceConstant) return [];Let's use `const` return values here and below to avoid the extra allocations.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Iterable<PragmaAnnotationData> _getPragmaAnnotation(ir.Constant constant) {This ought to be renamed too.
+1 to rename while we're touching call sites anyway.
https://dart.dev/effective-dart/design#avoid-starting-a-method-name-with-get
Map<Identifier, List<CallReference>> callMap = {};
//TODO(mosum): Also register the part file of the definition.
Map<Identifier, String> loadingUnits = {};Can these be `final`?
/// Save an [resourceIdentifier] in the [callMap].[nit]
```suggestion
/// Save a [resourceIdentifier] in the [callMap].
```
(callMap[identifier] ??= []).add([nit] The `??=` version can do two lookups, would `putIfAbsent` be better?
```suggestion
callMap.putIfAbsent(identifier, () => []).add(
```
final List<Constant?> constantArguments = [];
for (final constant in arguments.map(_findConstant)) {
constantArguments.add(constant != null ? _findValue(constant) : null);
}[optional]
```suggestion
final constantArguments = [
for (final argument in arguments.map(_findConstant))
if (_findConstant(argument) case final constant?) _findValue(constant),
];
```
/// Add in options to pass to the compiler like[nit] Can you find a noun phrase to serve as the header?
print('Test file: ${testFile.uri}');Should we remove this?
'A call was made to "$methodName" with the arguments (${call.positional[0] as int},${call.positional[1] as int})',[nit] manually split to 80 characters
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks everyone!
Gerrit is strict on not carrying forward +1s for addressing nits. Another round of +1s please 🤓
(Internal) customers will have to migrated.Nate BiggsYou can clone the failing g3 cl, migrate the customers and port the require changes to a separate g3 cl, and attach that CL to the cbuild. That should make it green here. (We cannot land this Gerrit CL without that.)
Daco Harkes+1
More generally, this is technically a breaking change. I'm not sure if anyone is using this feature on the web outside of internal users but we should still call it out in the CHANGELOG.
Daco HarkesI am taking over this CL. I have a WIP in cl/830421816, with one failing test which is the one single integration test of the use in g3. Hopefully I can get it working tomorrow.
Done
```suggestion
/// The URI for 'package:meta/meta.dart'.
```
Done
Iterable<PragmaAnnotationData> pragmaAnnotation = _getPragmaAnnotation(This should be named differently if it's now a collection. Or consider inlining it below.
Done
Iterable<PragmaAnnotationData> _getPragmaAnnotation(ir.Constant constant) {Nate BoschThis ought to be renamed too.
+1 to rename while we're touching call sites anyway.
https://dart.dev/effective-dart/design#avoid-starting-a-method-name-with-get
Done
Let's use `const` return values here and below to avoid the extra allocations.
Done
Map<Identifier, List<CallReference>> callMap = {};
//TODO(mosum): Also register the part file of the definition.
Map<Identifier, String> loadingUnits = {};Can these be `final`?
Done
[nit]
```suggestion
/// Save a [resourceIdentifier] in the [callMap].
```
Done
[nit] The `??=` version can do two lookups, would `putIfAbsent` be better?
```suggestion
callMap.putIfAbsent(identifier, () => []).add(
```
Done
final List<Constant?> constantArguments = [];
for (final constant in arguments.map(_findConstant)) {
constantArguments.add(constant != null ? _findValue(constant) : null);
}[optional]
```suggestion
final constantArguments = [
for (final argument in arguments.map(_findConstant))
if (_findConstant(argument) case final constant?) _findValue(constant),
];
```
I find that harder to read (and the nullability is off, we need an extra null check).
[nit] Can you find a noun phrase to serve as the header?
Done
print('Test file: ${testFile.uri}');Daco HarkesShould we remove this?
Done
'A call was made to "$methodName" with the arguments (${call.positional[0] as int},${call.positional[1] as int})',[nit] manually split to 80 characters
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
final List<Constant?> constantArguments = [];
for (final constant in arguments.map(_findConstant)) {
constantArguments.add(constant != null ? _findValue(constant) : null);
}Daco Harkes[optional]
```suggestion
final constantArguments = [
for (final argument in arguments.map(_findConstant))
if (_findConstant(argument) case final constant?) _findValue(constant),
];
```
I find that harder to read (and the nullability is off, we need an extra null check).
and the nullability is off, we need an extra null check
I don't see where the behavior is different. The `constant != null?` from your version translates to the `?` in `final constant?` in my version. I don't have an `else null` branch on my conditional because it let's us skip the `nonNulls` later.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
pkg/compiler LGTM
return [];```suggestion
return const [];
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
return [];```suggestion
return const [];
```
I'm going to do this in a separate CL to not lose the +1s again.
[dart2js] Migrate resource identifiers output to record use
First step into making both dart2js and the vm output the same
for recorded uses.
This CL changes the output format to be the same.
It does not
- change the annotations which are read,
- add support for named arguments,
- add support for const source locations, and
- test feature parity.
Bug: https://github.com/dart-lang/native/issues/2717
Internal customers are migrated in cl/830421816.
TEST=pkg/dartdev/test/native_assets/compile_test.dart
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I'm going to do this in a separate CL to not lose the +1s again.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |