| Index: pkg/compiler/lib/src/js_backend/backend_usage.dart
|
| diff --git a/pkg/compiler/lib/src/js_backend/backend_usage.dart b/pkg/compiler/lib/src/js_backend/backend_usage.dart
|
| index 068c16a3fca03da9b0f8aaada554ec2ca749a82a..8f83e04815700deceef21eab2c439c7f28774fe2 100644
|
| --- a/pkg/compiler/lib/src/js_backend/backend_usage.dart
|
| +++ b/pkg/compiler/lib/src/js_backend/backend_usage.dart
|
| @@ -122,23 +122,23 @@ class BackendUsageBuilderImpl implements BackendUsageBuilder {
|
|
|
| @override
|
| void registerBackendFunctionUse(FunctionEntity element) {
|
| - assert(invariant(element, _isValidBackendUse(element),
|
| - message: "Backend use of $element is not allowed."));
|
| + assert(_isValidBackendUse(element),
|
| + failedAt(element, "Backend use of $element is not allowed."));
|
| _helperFunctionsUsed.add(element);
|
| }
|
|
|
| @override
|
| void registerBackendClassUse(ClassEntity element) {
|
| - assert(invariant(element, _isValidBackendUse(element),
|
| - message: "Backend use of $element is not allowed."));
|
| + assert(_isValidBackendUse(element),
|
| + failedAt(element, "Backend use of $element is not allowed."));
|
| _helperClassesUsed.add(element);
|
| }
|
|
|
| bool _isValidBackendUse(Entity element) {
|
| if (_isValidEntity(element)) return true;
|
| if (element is Element) {
|
| - assert(invariant(element, element.isDeclaration,
|
| - message: "Backend use $element must be the declaration."));
|
| + assert(element.isDeclaration,
|
| + failedAt(element, "Backend use $element must be the declaration."));
|
| if (element.implementationLibrary.isPatch ||
|
| // Needed to detect deserialized injected elements, that is
|
| // element declared in patch files.
|
|
|