Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: pkg/compiler/lib/src/native/behavior.dart

Issue 2938823002: Starting making dart2js strong mode clean. (Closed)
Patch Set: Address some comments. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import '../common.dart'; 5 import '../common.dart';
6 import '../common/backend_api.dart' show ForeignResolver; 6 import '../common/backend_api.dart' show ForeignResolver;
7 import '../common/resolution.dart' show ParsingContext, Resolution; 7 import '../common/resolution.dart' show ParsingContext, Resolution;
8 import '../compiler.dart' show Compiler; 8 import '../compiler.dart' show Compiler;
9 import '../constants/values.dart'; 9 import '../constants/values.dart';
10 import '../common_elements.dart' show CommonElements; 10 import '../common_elements.dart' show CommonElements;
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 DiagnosticReporter reporter, 516 DiagnosticReporter reporter,
517 ParsingContext parsing, 517 ParsingContext parsing,
518 CommonElements commonElements, 518 CommonElements commonElements,
519 ForeignResolver resolver) { 519 ForeignResolver resolver) {
520 var argNodes = jsCall.arguments; 520 var argNodes = jsCall.arguments;
521 if (argNodes.isEmpty || argNodes.tail.isEmpty) { 521 if (argNodes.isEmpty || argNodes.tail.isEmpty) {
522 reporter.reportErrorMessage(jsCall, MessageKind.WRONG_ARGUMENT_FOR_JS); 522 reporter.reportErrorMessage(jsCall, MessageKind.WRONG_ARGUMENT_FOR_JS);
523 return new NativeBehavior(); 523 return new NativeBehavior();
524 } 524 }
525 525
526 var specArgument = argNodes.head; 526 dynamic specArgument = argNodes.head;
527 if (specArgument is! StringNode || specArgument.isInterpolation) { 527 if (specArgument is! StringNode || specArgument.isInterpolation) {
528 reporter.reportErrorMessage( 528 reporter.reportErrorMessage(
529 specArgument, MessageKind.WRONG_ARGUMENT_FOR_JS_FIRST); 529 specArgument, MessageKind.WRONG_ARGUMENT_FOR_JS_FIRST);
530 return new NativeBehavior(); 530 return new NativeBehavior();
531 } 531 }
532 532
533 var codeArgument = argNodes.tail.head; 533 dynamic codeArgument = argNodes.tail.head;
534 if (codeArgument is! StringNode || codeArgument.isInterpolation) { 534 if (codeArgument is! StringNode || codeArgument.isInterpolation) {
535 reporter.reportErrorMessage( 535 reporter.reportErrorMessage(
536 codeArgument, MessageKind.WRONG_ARGUMENT_FOR_JS_SECOND); 536 codeArgument, MessageKind.WRONG_ARGUMENT_FOR_JS_SECOND);
537 return new NativeBehavior(); 537 return new NativeBehavior();
538 } 538 }
539 539
540 String specString = specArgument.dartString.slowToString(); 540 String specString = specArgument.dartString.slowToString();
541 String codeString = codeArgument.dartString.slowToString(); 541 String codeString = codeArgument.dartString.slowToString();
542 542
543 return ofJsCall( 543 return ofJsCall(
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 @override 1045 @override
1046 bool get trustJSInteropTypeAnnotations => 1046 bool get trustJSInteropTypeAnnotations =>
1047 compiler.options.trustJSInteropTypeAnnotations; 1047 compiler.options.trustJSInteropTypeAnnotations;
1048 1048
1049 @override 1049 @override
1050 DiagnosticReporter get reporter => compiler.reporter; 1050 DiagnosticReporter get reporter => compiler.reporter;
1051 1051
1052 @override 1052 @override
1053 Resolution get resolution => compiler.resolution; 1053 Resolution get resolution => compiler.resolution;
1054 } 1054 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart ('k') | pkg/compiler/lib/src/util/maplet.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698