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

Side by Side Diff: pkg/compiler/lib/src/common/backend_api.dart

Issue 1651933002: Report error on JS-interop operator [] and []= methods. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Sort MessageKinds. Created 4 years, 10 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library dart2js.backend_api; 5 library dart2js.backend_api;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/codegen.dart' show 10 import '../common/codegen.dart' show
(...skipping 13 matching lines...) Expand all
24 ConstantValue; 24 ConstantValue;
25 import '../dart_types.dart' show 25 import '../dart_types.dart' show
26 DartType, 26 DartType,
27 InterfaceType; 27 InterfaceType;
28 import '../elements/elements.dart' show 28 import '../elements/elements.dart' show
29 ClassElement, 29 ClassElement,
30 ConstructorElement, 30 ConstructorElement,
31 Element, 31 Element,
32 FunctionElement, 32 FunctionElement,
33 LibraryElement, 33 LibraryElement,
34 MetadataAnnotation; 34 MetadataAnnotation,
35 MethodElement;
35 import '../enqueue.dart' show 36 import '../enqueue.dart' show
36 Enqueuer, 37 Enqueuer,
37 CodegenEnqueuer, 38 CodegenEnqueuer,
38 ResolutionEnqueuer; 39 ResolutionEnqueuer;
39 import '../io/code_output.dart' show 40 import '../io/code_output.dart' show
40 CodeBuffer; 41 CodeBuffer;
41 import '../io/source_information.dart' show 42 import '../io/source_information.dart' show
42 SourceInformationStrategy; 43 SourceInformationStrategy;
43 import '../js_backend/backend_helpers.dart' as js_backend show 44 import '../js_backend/backend_helpers.dart' as js_backend show
44 BackendHelpers; 45 BackendHelpers;
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 /// Returns `true` if [element] is implemented via typed JavaScript interop. 276 /// Returns `true` if [element] is implemented via typed JavaScript interop.
276 // TODO(johnniwinther): Move this to [JavaScriptBackend]. 277 // TODO(johnniwinther): Move this to [JavaScriptBackend].
277 bool isJsInterop(Element element) => false; 278 bool isJsInterop(Element element) => false;
278 279
279 /// Returns `true` if the `native` pseudo keyword is supported for [library]. 280 /// Returns `true` if the `native` pseudo keyword is supported for [library].
280 bool canLibraryUseNative(LibraryElement library) { 281 bool canLibraryUseNative(LibraryElement library) {
281 // TODO(johnniwinther): Move this to [JavaScriptBackend]. 282 // TODO(johnniwinther): Move this to [JavaScriptBackend].
282 return native.maybeEnableNative(compiler, library); 283 return native.maybeEnableNative(compiler, library);
283 } 284 }
284 285
285 /// Processes [element] for resolution and returns the [FunctionElement] that 286 /// Processes [element] for resolution and returns the [MethodElement] that
286 /// defines the implementation of [element]. 287 /// defines the implementation of [element].
287 FunctionElement resolveExternalFunction(FunctionElement element) => element; 288 MethodElement resolveExternalFunction(MethodElement element) => element;
288 289
289 /// Returns `true` if [library] is a backend specific library whose members 290 /// Returns `true` if [library] is a backend specific library whose members
290 /// have special treatment, such as being allowed to extends blacklisted 291 /// have special treatment, such as being allowed to extends blacklisted
291 /// classes or member being eagerly resolved. 292 /// classes or member being eagerly resolved.
292 bool isBackendLibrary(LibraryElement library) { 293 bool isBackendLibrary(LibraryElement library) {
293 // TODO(johnniwinther): Remove this when patching is only done by the 294 // TODO(johnniwinther): Remove this when patching is only done by the
294 // JavaScript backend. 295 // JavaScript backend.
295 Uri canonicalUri = library.canonicalUri; 296 Uri canonicalUri = library.canonicalUri;
296 if (canonicalUri == js_backend.BackendHelpers.DART_JS_HELPER || 297 if (canonicalUri == js_backend.BackendHelpers.DART_JS_HELPER ||
297 canonicalUri == js_backend.BackendHelpers.DART_INTERCEPTORS) { 298 canonicalUri == js_backend.BackendHelpers.DART_INTERCEPTORS) {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) { 455 WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) {
455 return worldImpact; 456 return worldImpact;
456 } 457 }
457 458
458 /// Transform the [CodegenImpact] into a [WorldImpact] adding the 459 /// Transform the [CodegenImpact] into a [WorldImpact] adding the
459 /// backend dependencies for features used in [worldImpact]. 460 /// backend dependencies for features used in [worldImpact].
460 WorldImpact transformCodegenImpact(CodegenImpact worldImpact) { 461 WorldImpact transformCodegenImpact(CodegenImpact worldImpact) {
461 return worldImpact; 462 return worldImpact;
462 } 463 }
463 } 464 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698