OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 'dart:async'; | |
6 | |
7 import 'package:async_helper/async_helper.dart'; | 5 import 'package:async_helper/async_helper.dart'; |
8 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
9 import 'memory_compiler.dart'; | 7 import 'memory_compiler.dart'; |
10 | 8 |
11 // Use strict does not allow parameters or locals named "arguments" or "eval". | 9 // Use strict does not allow parameters or locals named "arguments" or "eval". |
12 | 10 |
13 const MEMORY_SOURCE_FILES = const { | 11 const MEMORY_SOURCE_FILES = const { |
14 'main.dart': ''' | 12 'main.dart': ''' |
15 class A { | 13 class A { |
16 final arguments; | 14 final arguments; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 .where((String line) => !commentLine.hasMatch(line)) | 58 .where((String line) => !commentLine.hasMatch(line)) |
61 .join("\n"); | 59 .join("\n"); |
62 | 60 |
63 // TODO(floitsch): we will need to adjust this filter if we start using | 61 // TODO(floitsch): we will need to adjust this filter if we start using |
64 // 'eval' or 'arguments' ourselves. Currently we disallow any 'eval' or | 62 // 'eval' or 'arguments' ourselves. Currently we disallow any 'eval' or |
65 // 'arguments'. | 63 // 'arguments'. |
66 RegExp re = new RegExp(r'[^\w$](arguments|eval)[^\w$]'); | 64 RegExp re = new RegExp(r'[^\w$](arguments|eval)[^\w$]'); |
67 Expect.isFalse(re.hasMatch(filtered)); | 65 Expect.isFalse(re.hasMatch(filtered)); |
68 }); | 66 }); |
69 } | 67 } |
OLD | NEW |