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

Side by Side Diff: tests/language/await_backwards_compatibility_test.dart

Issue 507233002: Fix conditionally parsing await as keyword. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix typo Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/symbols.h ('k') | tests/language/language.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // VMOptions=--enable_async
6
7 import 'dart:async';
8
9 import 'package:expect/expect.dart';
10
11 get await => 4;
12
13 // For functions that are declared with the async modifier we treat await as
14 // keyword.
15
16 test0() async {
17 var x = await 7;
18 Expect.equals(7, x);
19 var await = 1; /// await1: compile-time error
20 }
21
22 test1() async {
23 var x = await 9;
24 Expect.equals(9, x);
25 var y = await; /// await2: compile-time error
26 }
27
28 // For functions that are not declared with the async modifier we allow await to
29 // be used as an identifier.
30
31 test2() {
32 var y = await;
33 Expect.equals(4, y);
34 var x = await 1; /// await3: compile-time error
35 }
36
37 test3() {
38 var await = 3;
39 Expect.equals(3, await);
40 var x = await 1; /// await4: compile-time error
41 }
42
43 main() {
44 test0();
45 test1();
46 test2();
47 test3();
48 }
OLDNEW
« no previous file with comments | « runtime/vm/symbols.h ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698