OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 dart.core; | 5 part of dart.core; |
6 | 6 |
7 /// Opaque name used by mirrors, invocations and [Function.apply]. | 7 /// Opaque name used by mirrors, invocations and [Function.apply]. |
8 class Symbol { | 8 class Symbol { |
9 /** | 9 /** |
10 * Constructs a new Symbol. | 10 * Constructs a new Symbol. |
11 * | 11 * |
12 * An [ArgumentError] is thrown if [name] starts with an underscore, or if | 12 * The name must be a valid public Dart member name, |
13 * [name] is not a [String]. An [ArgumentError] is thrown if [name] is not | 13 * public constructor name, or library name. |
14 * an empty string and is not a valid qualified identifier optionally | 14 * That means that the content of the [name] String must be either |
15 * followed by [:'=':]. | 15 * |
16 * * a valid Dart identifier not starting with "`_`", | |
17 * * such an identifier followed by "=" (a setter name), | |
18 * * or the name of an operator | |
19 * (one of "`+`", "`-`", "`*`", "`/`", "`%`", "`~/`", "`&`", "`|`", | |
20 * "`^`", "`~`", "`<<`", "`>>`", "`<`", "`<=`", "`>`", "`>=`", "`==`", | |
21 * "`[]`", "`[]=`", or "`unary-`"), | |
22 * * The empty string (the default constructor name), or | |
23 * * A '`.`' separated sequence of identifiers (a library name). This must | |
24 * also not begin with an underscore ("`_`"). | |
floitsch
2014/01/31 14:37:24
Why is _foo.bar not allowed, but foo._bar is?
Lasse Reichstein Nielsen
2014/01/31 18:19:26
Because I saw no need to disallow foo._bar.
The pr
ahe
2014/02/13 21:56:54
I don't think this is correct, and I look forward
| |
16 * | 25 * |
17 * The following text is non-normative: | 26 * The following text is non-normative: |
18 * | 27 * |
19 * Creating non-const Symbol instances may result in larger output. If | 28 * Creating non-const Symbol instances may result in larger output. If |
20 * possible, use [MirrorsUsed] in "dart:mirrors" to specify which names might | 29 * possible, use [MirrorsUsed] in "dart:mirrors" to specify which names might |
21 * be passed to this constructor. | 30 * be passed to this constructor. |
22 */ | 31 */ |
23 const factory Symbol(String name) = internal.Symbol; | 32 const factory Symbol(String name) = internal.Symbol; |
24 } | 33 } |
OLD | NEW |