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

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

Issue 1408043002: Move native and js interop properties from the element model to the JS backend (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 1 month 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 | « pkg/compiler/lib/src/native/native.dart ('k') | pkg/compiler/lib/src/native/ssa.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) 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 part of native; 5 part of native;
6 6
7 void checkAllowedLibrary(ElementListener listener, Token token) { 7 void checkAllowedLibrary(ElementListener listener, Token token) {
8 LibraryElement currentLibrary = listener.compilationUnitElement.library; 8 if (listener.scannerOptions.canUseNative) return;
9 if (currentLibrary.canUseNative) return;
10 listener.reportError(token, MessageKind.NATIVE_NOT_SUPPORTED); 9 listener.reportError(token, MessageKind.NATIVE_NOT_SUPPORTED);
11 } 10 }
12 11
13 Token handleNativeBlockToSkip(Listener listener, Token token) { 12 Token handleNativeBlockToSkip(Listener listener, Token token) {
14 checkAllowedLibrary(listener, token); 13 checkAllowedLibrary(listener, token);
15 token = token.next; 14 token = token.next;
16 if (identical(token.kind, Tokens.STRING_TOKEN)) { 15 if (identical(token.kind, Tokens.STRING_TOKEN)) {
17 token = token.next; 16 token = token.next;
18 } 17 }
19 if (identical(token.stringValue, '{')) { 18 if (identical(token.stringValue, '{')) {
(...skipping 13 matching lines...) Expand all
33 hasExpression = true; 32 hasExpression = true;
34 listener.beginLiteralString(token); 33 listener.beginLiteralString(token);
35 listener.endLiteralString(0); 34 listener.endLiteralString(0);
36 token = token.next; 35 token = token.next;
37 } 36 }
38 listener.endReturnStatement(hasExpression, begin, token); 37 listener.endReturnStatement(hasExpression, begin, token);
39 // TODO(ngeoffray): expect a ';'. 38 // TODO(ngeoffray): expect a ';'.
40 // Currently there are method with both native marker and Dart body. 39 // Currently there are method with both native marker and Dart body.
41 return token.next; 40 return token.next;
42 } 41 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/native/native.dart ('k') | pkg/compiler/lib/src/native/ssa.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698