| 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 library path.context; | 5 library path.context; |
| 6 | 6 |
| 7 import 'internal_style.dart'; | 7 import 'internal_style.dart'; |
| 8 import 'style.dart'; | 8 import 'style.dart'; |
| 9 import 'parsed_path.dart'; | 9 import 'parsed_path.dart'; |
| 10 import 'path_exception.dart'; | 10 import 'path_exception.dart'; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 style = Style.platform; | 37 style = Style.platform; |
| 38 } else if (style is! InternalStyle) { | 38 } else if (style is! InternalStyle) { |
| 39 throw new ArgumentError("Only styles defined by the path package are " | 39 throw new ArgumentError("Only styles defined by the path package are " |
| 40 "allowed."); | 40 "allowed."); |
| 41 } | 41 } |
| 42 | 42 |
| 43 return new Context._(style, current); | 43 return new Context._(style, current); |
| 44 } | 44 } |
| 45 | 45 |
| 46 /// Create a [Context] to be used internally within path. | 46 /// Create a [Context] to be used internally within path. |
| 47 Context._internal() : style = Style.platform; | 47 Context._internal() : style = Style.platform, _current = null; |
| 48 | 48 |
| 49 Context._(this.style, this._current); | 49 Context._(this.style, this._current); |
| 50 | 50 |
| 51 /// The style of path that this context works with. | 51 /// The style of path that this context works with. |
| 52 final InternalStyle style; | 52 final InternalStyle style; |
| 53 | 53 |
| 54 /// The current directory given when Context was created. If null, current | 54 /// The current directory given when Context was created. If null, current |
| 55 /// directory is evaluated from 'p.current'. | 55 /// directory is evaluated from 'p.current'. |
| 56 final String _current; | 56 final String _current; |
| 57 | 57 |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 // Show the arguments. | 547 // Show the arguments. |
| 548 var message = new StringBuffer(); | 548 var message = new StringBuffer(); |
| 549 message.write("$method("); | 549 message.write("$method("); |
| 550 message.write(args.take(numArgs) | 550 message.write(args.take(numArgs) |
| 551 .map((arg) => arg == null ? "null" : '"$arg"') | 551 .map((arg) => arg == null ? "null" : '"$arg"') |
| 552 .join(", ")); | 552 .join(", ")); |
| 553 message.write("): part ${i - 1} was null, but part $i was not."); | 553 message.write("): part ${i - 1} was null, but part $i was not."); |
| 554 throw new ArgumentError(message.toString()); | 554 throw new ArgumentError(message.toString()); |
| 555 } | 555 } |
| 556 } | 556 } |
| OLD | NEW |