Index: pkg/compiler/lib/src/native/ssa.dart |
diff --git a/pkg/compiler/lib/src/native/ssa.dart b/pkg/compiler/lib/src/native/ssa.dart |
index 970a7e64a5a97a7a4b07fbb4db1c66aec286544c..70b022171a6aa8975c98dc25ed047e1ad8262338 100644 |
--- a/pkg/compiler/lib/src/native/ssa.dart |
+++ b/pkg/compiler/lib/src/native/ssa.dart |
@@ -3,7 +3,6 @@ |
// BSD-style license that can be found in the LICENSE file. |
import '../common.dart'; |
-import '../compiler.dart' show Compiler; |
import '../constants/values.dart'; |
import '../elements/resolution_types.dart'; |
import '../elements/elements.dart'; |
@@ -18,11 +17,9 @@ import '../universe/side_effects.dart' show SideEffects; |
final RegExp nativeRedirectionRegExp = new RegExp(r'^[a-zA-Z][a-zA-Z_$0-9]*$'); |
void handleSsaNative(SsaBuilder builder, Expression nativeBody) { |
- Compiler compiler = builder.compiler; |
MethodElement element = builder.target; |
NativeEmitter nativeEmitter = builder.nativeEmitter; |
JavaScriptBackend backend = builder.backend; |
- DiagnosticReporter reporter = compiler.reporter; |
HInstruction convertDartClosure( |
ParameterElement parameter, ResolutionFunctionType type) { |
@@ -53,7 +50,7 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) { |
LiteralString jsCode = nativeBody.asLiteralString(); |
String str = jsCode.dartString.slowToString(); |
if (nativeRedirectionRegExp.hasMatch(str)) { |
- reporter.internalError( |
+ throw new SpannableAssertionFailure( |
nativeBody, "Deprecated syntax, use @JSName('name') instead."); |
} |
hasBody = true; |
@@ -93,8 +90,8 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) { |
} else if (element.kind == ElementKind.SETTER) { |
nativeMethodCall = '$receiver$nativeMethodName = $foreignParameters'; |
} else { |
- builder.reporter |
- .internalError(element, 'Unexpected kind: "${element.kind}".'); |
+ throw new SpannableAssertionFailure( |
+ element, 'Unexpected kind: "${element.kind}".'); |
} |
builder.push(new HForeignCode( |
@@ -111,7 +108,7 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) { |
.addSuccessor(builder.graph.exit); |
} else { |
if (parameters.parameterCount != 0) { |
- reporter.internalError( |
+ throw new SpannableAssertionFailure( |
nativeBody, |
'native "..." syntax is restricted to ' |
'functions with zero parameters.'); |