OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Implementation of the element model used for deserialiation. | 5 /// Implementation of the element model used for deserialiation. |
6 /// | 6 /// |
7 /// These classes are created by [ElementDeserializer] triggered by the | 7 /// These classes are created by [ElementDeserializer] triggered by the |
8 /// [Deserializer]. | 8 /// [Deserializer]. |
9 | 9 |
10 library dart2js.serialization.modelz; | 10 library dart2js.serialization.modelz; |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 if (_imports == null) { | 488 if (_imports == null) { |
489 _imports = _decoder.getElements(Key.IMPORTS, isOptional: true); | 489 _imports = _decoder.getElements(Key.IMPORTS, isOptional: true); |
490 } | 490 } |
491 return _imports; | 491 return _imports; |
492 } | 492 } |
493 } | 493 } |
494 | 494 |
495 class ScriptZ implements Script { | 495 class ScriptZ implements Script { |
496 final Uri resourceUri; | 496 final Uri resourceUri; |
497 SourceFile _file; | 497 SourceFile _file; |
| 498 bool _isSynthesized = false; |
498 | 499 |
499 ScriptZ(this.resourceUri); | 500 ScriptZ(this.resourceUri); |
500 | 501 |
501 @override | 502 @override |
502 Script copyWithFile(SourceFile file) { | 503 Script copyWithFile(SourceFile file) { |
503 throw new UnsupportedError('ScriptZ.copyWithFile'); | 504 throw new UnsupportedError('ScriptZ.copyWithFile'); |
504 } | 505 } |
505 | 506 |
506 @override | 507 @override |
507 SourceFile get file { | 508 SourceFile get file { |
508 if (_file == null) { | 509 if (_file == null) { |
509 throw new UnsupportedError('ScriptZ.file'); | 510 throw new UnsupportedError('ScriptZ.file'); |
510 } | 511 } |
511 return _file; | 512 return _file; |
512 } | 513 } |
513 | 514 |
514 void set file(SourceFile value) { | 515 void set file(SourceFile value) { |
515 _file = value; | 516 _file = value; |
516 } | 517 } |
517 | 518 |
518 // TODO(johnniwinther): Decide if it is meaningful to serialize erroneous | 519 // TODO(johnniwinther): Decide if it is meaningful to serialize erroneous |
519 // elements. | 520 // elements. |
520 @override | 521 @override |
521 bool get isSynthesized => false; | 522 bool get isSynthesized => _isSynthesized; |
| 523 |
| 524 void set isSynthesized(bool value) { |
| 525 _isSynthesized = value; |
| 526 } |
522 | 527 |
523 @override | 528 @override |
524 String get name { | 529 String get name { |
525 if (_file != null) { | 530 if (_file != null) { |
526 return _file.filename; | 531 return _file.filename; |
527 } | 532 } |
528 return resourceUri.toString(); | 533 return resourceUri.toString(); |
529 } | 534 } |
530 | 535 |
531 // TODO(johnniwinther): Support the distinction between [readableUri] and | 536 // TODO(johnniwinther): Support the distinction between [readableUri] and |
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2155 } | 2160 } |
2156 | 2161 |
2157 @override | 2162 @override |
2158 ElementKind get kind => ElementKind.PREFIX; | 2163 ElementKind get kind => ElementKind.PREFIX; |
2159 | 2164 |
2160 @override | 2165 @override |
2161 Element lookupLocalMember(String memberName) { | 2166 Element lookupLocalMember(String memberName) { |
2162 return _unsupported('lookupLocalMember'); | 2167 return _unsupported('lookupLocalMember'); |
2163 } | 2168 } |
2164 } | 2169 } |
OLD | NEW |