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

Side by Side Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 147903005: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 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 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine; 8 library engine;
9 9
10 import 'java_core.dart'; 10 import 'java_core.dart';
(...skipping 5329 matching lines...) Expand 10 before | Expand all | Expand 10 after
5340 _cache.put(source, dartCopy); 5340 _cache.put(source, dartCopy);
5341 dartEntry = dartCopy; 5341 dartEntry = dartCopy;
5342 } else { 5342 } else {
5343 logInformation2("Generated errors discarded for ${debuggingString(source )}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTime = ${dartEn try.modificationTime}", thrownException); 5343 logInformation2("Generated errors discarded for ${debuggingString(source )}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTime = ${dartEn try.modificationTime}", thrownException);
5344 DartEntryImpl dartCopy = dartEntry.writableCopy; 5344 DartEntryImpl dartCopy = dartEntry.writableCopy;
5345 if (thrownException == null || resultTime >= 0) { 5345 if (thrownException == null || resultTime >= 0) {
5346 // 5346 //
5347 // The analysis was performed on out-of-date sources. Mark the cache s o that the source 5347 // The analysis was performed on out-of-date sources. Mark the cache s o that the source
5348 // will be re-verified using the up-to-date sources. 5348 // will be re-verified using the up-to-date sources.
5349 // 5349 //
5350 dartCopy.setState2(DartEntry.VERIFICATION_ERRORS, librarySource, Cache State.INVALID); 5350 // dartCopy.setState(DartEntry.VERIFICATION_ERRORS, librarySo urce, CacheState.INVALID);
5351 dartCopy.invalidateAllInformation();
5352 dartCopy.modificationTime = sourceTime;
5351 } else { 5353 } else {
5352 // 5354 //
5353 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the 5355 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the
5354 // cache so that we won't attempt to re-verify the source until there' s a good chance 5356 // cache so that we won't attempt to re-verify the source until there' s a good chance
5355 // that we'll be able to do so without error. 5357 // that we'll be able to do so without error.
5356 // 5358 //
5357 dartCopy.setState2(DartEntry.VERIFICATION_ERRORS, librarySource, Cache State.ERROR); 5359 dartCopy.setState2(DartEntry.VERIFICATION_ERRORS, librarySource, Cache State.ERROR);
5358 } 5360 }
5359 dartCopy.exception = thrownException; 5361 dartCopy.exception = thrownException;
5360 _cache.put(source, dartCopy); 5362 _cache.put(source, dartCopy);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
5439 dartEntry = dartCopy; 5441 dartEntry = dartCopy;
5440 } else { 5442 } else {
5441 logInformation2("Generated hints discarded for ${debuggingString(unitS ource)}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTime = ${d artEntry.modificationTime}", thrownException); 5443 logInformation2("Generated hints discarded for ${debuggingString(unitS ource)}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTime = ${d artEntry.modificationTime}", thrownException);
5442 if (identical(dartEntry.getState2(DartEntry.HINTS, librarySource), Cac heState.IN_PROCESS)) { 5444 if (identical(dartEntry.getState2(DartEntry.HINTS, librarySource), Cac heState.IN_PROCESS)) {
5443 DartEntryImpl dartCopy = dartEntry.writableCopy; 5445 DartEntryImpl dartCopy = dartEntry.writableCopy;
5444 if (thrownException == null || resultTime >= 0) { 5446 if (thrownException == null || resultTime >= 0) {
5445 // 5447 //
5446 // The analysis was performed on out-of-date sources. Mark the cac he so that the sources 5448 // The analysis was performed on out-of-date sources. Mark the cac he so that the sources
5447 // will be re-analyzed using the up-to-date sources. 5449 // will be re-analyzed using the up-to-date sources.
5448 // 5450 //
5449 dartCopy.setState2(DartEntry.HINTS, librarySource, CacheState.INVA LID); 5451 // dartCopy.setState(DartEntry.HINTS, librarySource, CacheState.INVALID);
5452 dartCopy.invalidateAllInformation();
5453 dartCopy.modificationTime = sourceTime;
5450 } else { 5454 } else {
5451 // 5455 //
5452 // We could not determine whether the sources were up-to-date or o ut-of-date. Mark the 5456 // We could not determine whether the sources were up-to-date or o ut-of-date. Mark the
5453 // cache so that we won't attempt to re-analyze the sources until there's a good chance 5457 // cache so that we won't attempt to re-analyze the sources until there's a good chance
5454 // that we'll be able to do so without error. 5458 // that we'll be able to do so without error.
5455 // 5459 //
5456 dartCopy.setState2(DartEntry.HINTS, librarySource, CacheState.ERRO R); 5460 dartCopy.setState2(DartEntry.HINTS, librarySource, CacheState.ERRO R);
5457 } 5461 }
5458 dartCopy.exception = thrownException; 5462 dartCopy.exception = thrownException;
5459 _cache.put(unitSource, dartCopy); 5463 _cache.put(unitSource, dartCopy);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
5542 _cache.put(source, dartCopy); 5546 _cache.put(source, dartCopy);
5543 dartEntry = dartCopy; 5547 dartEntry = dartCopy;
5544 } else { 5548 } else {
5545 logInformation2("Parse results discarded for ${debuggingString(source)}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTime = ${dartEntry .modificationTime}", thrownException); 5549 logInformation2("Parse results discarded for ${debuggingString(source)}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTime = ${dartEntry .modificationTime}", thrownException);
5546 DartEntryImpl dartCopy = dartEntry.writableCopy; 5550 DartEntryImpl dartCopy = dartEntry.writableCopy;
5547 if (thrownException == null || resultTime >= 0) { 5551 if (thrownException == null || resultTime >= 0) {
5548 // 5552 //
5549 // The analysis was performed on out-of-date sources. Mark the cache s o that the sources 5553 // The analysis was performed on out-of-date sources. Mark the cache s o that the sources
5550 // will be re-analyzed using the up-to-date sources. 5554 // will be re-analyzed using the up-to-date sources.
5551 // 5555 //
5552 dartCopy.recordParseNotInProcess(); 5556 // dartCopy.recordParseNotInProcess();
5557 dartCopy.invalidateAllInformation();
5558 dartCopy.modificationTime = sourceTime;
5553 } else { 5559 } else {
5554 // 5560 //
5555 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the 5561 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the
5556 // cache so that we won't attempt to re-analyze the sources until ther e's a good chance 5562 // cache so that we won't attempt to re-analyze the sources until ther e's a good chance
5557 // that we'll be able to do so without error. 5563 // that we'll be able to do so without error.
5558 // 5564 //
5559 dartCopy.recordParseError(); 5565 dartCopy.recordParseError();
5560 } 5566 }
5561 dartCopy.exception = thrownException; 5567 dartCopy.exception = thrownException;
5562 _cache.put(source, dartCopy); 5568 _cache.put(source, dartCopy);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
5618 _cache.put(source, htmlCopy); 5624 _cache.put(source, htmlCopy);
5619 htmlEntry = htmlCopy; 5625 htmlEntry = htmlCopy;
5620 } else { 5626 } else {
5621 logInformation2("Parse results discarded for ${debuggingString(source)}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTime = ${htmlEntry .modificationTime}", thrownException); 5627 logInformation2("Parse results discarded for ${debuggingString(source)}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTime = ${htmlEntry .modificationTime}", thrownException);
5622 HtmlEntryImpl htmlCopy = (sourceEntry as HtmlEntry).writableCopy; 5628 HtmlEntryImpl htmlCopy = (sourceEntry as HtmlEntry).writableCopy;
5623 if (thrownException == null || resultTime >= 0) { 5629 if (thrownException == null || resultTime >= 0) {
5624 // 5630 //
5625 // The analysis was performed on out-of-date sources. Mark the cache s o that the sources 5631 // The analysis was performed on out-of-date sources. Mark the cache s o that the sources
5626 // will be re-analyzed using the up-to-date sources. 5632 // will be re-analyzed using the up-to-date sources.
5627 // 5633 //
5628 if (identical(htmlCopy.getState(SourceEntry.LINE_INFO), CacheState.IN_ PROCESS)) { 5634 // if (htmlCopy.getState(SourceEntry.LINE_INFO) == CacheState .IN_PROCESS) {
5629 htmlCopy.setState(SourceEntry.LINE_INFO, CacheState.INVALID); 5635 // htmlCopy.setState(SourceEntry.LINE_INFO, CacheState.INVA LID);
5630 } 5636 // }
5631 if (identical(htmlCopy.getState(HtmlEntry.PARSED_UNIT), CacheState.IN_ PROCESS)) { 5637 // if (htmlCopy.getState(HtmlEntry.PARSED_UNIT) == CacheState .IN_PROCESS) {
5632 htmlCopy.setState(HtmlEntry.PARSED_UNIT, CacheState.INVALID); 5638 // htmlCopy.setState(HtmlEntry.PARSED_UNIT, CacheState.INVA LID);
5633 } 5639 // }
5634 if (identical(htmlCopy.getState(HtmlEntry.REFERENCED_LIBRARIES), Cache State.IN_PROCESS)) { 5640 // if (htmlCopy.getState(HtmlEntry.REFERENCED_LIBRARIES) == C acheState.IN_PROCESS) {
5635 htmlCopy.setState(HtmlEntry.REFERENCED_LIBRARIES, CacheState.INVALID ); 5641 // htmlCopy.setState(HtmlEntry.REFERENCED_LIBRARIES, CacheS tate.INVALID);
5636 } 5642 // }
5643 htmlCopy.invalidateAllInformation();
5644 htmlCopy.modificationTime = sourceTime;
5637 } else { 5645 } else {
5638 // 5646 //
5639 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the 5647 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the
5640 // cache so that we won't attempt to re-analyze the sources until ther e's a good chance 5648 // cache so that we won't attempt to re-analyze the sources until ther e's a good chance
5641 // that we'll be able to do so without error. 5649 // that we'll be able to do so without error.
5642 // 5650 //
5643 htmlCopy.setState(SourceEntry.LINE_INFO, CacheState.ERROR); 5651 htmlCopy.setState(SourceEntry.LINE_INFO, CacheState.ERROR);
5644 htmlCopy.setState(HtmlEntry.PARSED_UNIT, CacheState.ERROR); 5652 htmlCopy.setState(HtmlEntry.PARSED_UNIT, CacheState.ERROR);
5645 htmlCopy.setState(HtmlEntry.REFERENCED_LIBRARIES, CacheState.ERROR); 5653 htmlCopy.setState(HtmlEntry.REFERENCED_LIBRARIES, CacheState.ERROR);
5646 } 5654 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
5698 htmlCopy.exception = thrownException; 5706 htmlCopy.exception = thrownException;
5699 _cache.put(source, htmlCopy); 5707 _cache.put(source, htmlCopy);
5700 htmlEntry = htmlCopy; 5708 htmlEntry = htmlCopy;
5701 } else { 5709 } else {
5702 HtmlEntryImpl htmlCopy = htmlEntry.writableCopy; 5710 HtmlEntryImpl htmlCopy = htmlEntry.writableCopy;
5703 if (thrownException == null || resultTime >= 0) { 5711 if (thrownException == null || resultTime >= 0) {
5704 // 5712 //
5705 // The analysis was performed on out-of-date sources. Mark the cache s o that the sources 5713 // The analysis was performed on out-of-date sources. Mark the cache s o that the sources
5706 // will be re-analyzed using the up-to-date sources. 5714 // will be re-analyzed using the up-to-date sources.
5707 // 5715 //
5708 if (identical(htmlCopy.getState(HtmlEntry.ANGULAR_ERRORS), CacheState. IN_PROCESS)) { 5716 // if (htmlCopy.getState(HtmlEntry.ANGULAR_ERRORS) == CacheSt ate.IN_PROCESS) {
5709 htmlCopy.setState(HtmlEntry.ANGULAR_ERRORS, CacheState.INVALID); 5717 // htmlCopy.setState(HtmlEntry.ANGULAR_ERRORS, CacheState.I NVALID);
5710 } 5718 // }
5711 if (identical(htmlCopy.getState(HtmlEntry.ELEMENT), CacheState.IN_PROC ESS)) { 5719 // if (htmlCopy.getState(HtmlEntry.ELEMENT) == CacheState.IN_ PROCESS) {
5712 htmlCopy.setState(HtmlEntry.ELEMENT, CacheState.INVALID); 5720 // htmlCopy.setState(HtmlEntry.ELEMENT, CacheState.INVALID) ;
5713 } 5721 // }
5714 if (identical(htmlCopy.getState(HtmlEntry.RESOLUTION_ERRORS), CacheSta te.IN_PROCESS)) { 5722 // if (htmlCopy.getState(HtmlEntry.RESOLUTION_ERRORS) == Cach eState.IN_PROCESS) {
5715 htmlCopy.setState(HtmlEntry.RESOLUTION_ERRORS, CacheState.INVALID); 5723 // htmlCopy.setState(HtmlEntry.RESOLUTION_ERRORS, CacheStat e.INVALID);
5716 } 5724 // }
5725 htmlCopy.invalidateAllInformation();
5726 htmlCopy.modificationTime = sourceTime;
5717 } else { 5727 } else {
5718 // 5728 //
5719 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the 5729 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the
5720 // cache so that we won't attempt to re-analyze the sources until ther e's a good chance 5730 // cache so that we won't attempt to re-analyze the sources until ther e's a good chance
5721 // that we'll be able to do so without error. 5731 // that we'll be able to do so without error.
5722 // 5732 //
5723 htmlCopy.recordResolutionError(); 5733 htmlCopy.recordResolutionError();
5724 } 5734 }
5725 htmlCopy.exception = thrownException; 5735 htmlCopy.exception = thrownException;
5726 _cache.put(source, htmlCopy); 5736 _cache.put(source, htmlCopy);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
5777 _cache.put(source, dartCopy); 5787 _cache.put(source, dartCopy);
5778 dartEntry = dartCopy; 5788 dartEntry = dartCopy;
5779 } else { 5789 } else {
5780 logInformation2("Dependency resolution results discarded for ${debugging String(source)}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTi me = ${dartEntry.modificationTime}", thrownException); 5790 logInformation2("Dependency resolution results discarded for ${debugging String(source)}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTi me = ${dartEntry.modificationTime}", thrownException);
5781 DartEntryImpl dartCopy = dartEntry.writableCopy; 5791 DartEntryImpl dartCopy = dartEntry.writableCopy;
5782 if (thrownException == null || resultTime >= 0) { 5792 if (thrownException == null || resultTime >= 0) {
5783 // 5793 //
5784 // The analysis was performed on out-of-date sources. Mark the cache s o that the sources 5794 // The analysis was performed on out-of-date sources. Mark the cache s o that the sources
5785 // will be re-analyzed using the up-to-date sources. 5795 // will be re-analyzed using the up-to-date sources.
5786 // 5796 //
5787 dartCopy.recordDependencyNotInProcess(); 5797 // dartCopy.recordDependencyNotInProcess();
5798 dartCopy.invalidateAllInformation();
5799 dartCopy.modificationTime = sourceTime;
5788 } else { 5800 } else {
5789 // 5801 //
5790 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the 5802 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the
5791 // cache so that we won't attempt to re-analyze the sources until ther e's a good chance 5803 // cache so that we won't attempt to re-analyze the sources until ther e's a good chance
5792 // that we'll be able to do so without error. 5804 // that we'll be able to do so without error.
5793 // 5805 //
5794 dartCopy.setState(DartEntry.EXPORTED_LIBRARIES, CacheState.ERROR); 5806 dartCopy.setState(DartEntry.EXPORTED_LIBRARIES, CacheState.ERROR);
5795 dartCopy.setState(DartEntry.IMPORTED_LIBRARIES, CacheState.ERROR); 5807 dartCopy.setState(DartEntry.IMPORTED_LIBRARIES, CacheState.ERROR);
5796 dartCopy.setState(DartEntry.INCLUDED_PARTS, CacheState.ERROR); 5808 dartCopy.setState(DartEntry.INCLUDED_PARTS, CacheState.ERROR);
5797 } 5809 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
5849 _cache.put(unitSource, dartCopy); 5861 _cache.put(unitSource, dartCopy);
5850 dartEntry = dartCopy; 5862 dartEntry = dartCopy;
5851 } else { 5863 } else {
5852 logInformation2("Resolution results discarded for ${debuggingString(unit Source)}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTime = ${ dartEntry.modificationTime}", thrownException); 5864 logInformation2("Resolution results discarded for ${debuggingString(unit Source)}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTime = ${ dartEntry.modificationTime}", thrownException);
5853 DartEntryImpl dartCopy = dartEntry.writableCopy; 5865 DartEntryImpl dartCopy = dartEntry.writableCopy;
5854 if (thrownException == null || resultTime >= 0) { 5866 if (thrownException == null || resultTime >= 0) {
5855 // 5867 //
5856 // The analysis was performed on out-of-date sources. Mark the cache s o that the sources 5868 // The analysis was performed on out-of-date sources. Mark the cache s o that the sources
5857 // will be re-analyzed using the up-to-date sources. 5869 // will be re-analyzed using the up-to-date sources.
5858 // 5870 //
5859 if (identical(dartCopy.getState(DartEntry.RESOLVED_UNIT), CacheState.I N_PROCESS)) { 5871 // if (dartCopy.getState(DartEntry.RESOLVED_UNIT) == CacheSta te.IN_PROCESS) {
5860 dartCopy.setState2(DartEntry.RESOLVED_UNIT, librarySource, CacheStat e.INVALID); 5872 // dartCopy.setState(DartEntry.RESOLVED_UNIT, librarySource , CacheState.INVALID);
5861 } 5873 // }
5874 dartCopy.invalidateAllInformation();
5875 dartCopy.modificationTime = sourceTime;
5862 } else { 5876 } else {
5863 // 5877 //
5864 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the 5878 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the
5865 // cache so that we won't attempt to re-analyze the sources until ther e's a good chance 5879 // cache so that we won't attempt to re-analyze the sources until ther e's a good chance
5866 // that we'll be able to do so without error. 5880 // that we'll be able to do so without error.
5867 // 5881 //
5868 dartCopy.setState2(DartEntry.RESOLVED_UNIT, librarySource, CacheState. ERROR); 5882 dartCopy.setState2(DartEntry.RESOLVED_UNIT, librarySource, CacheState. ERROR);
5869 } 5883 }
5870 dartCopy.exception = thrownException; 5884 dartCopy.exception = thrownException;
5871 _cache.put(unitSource, dartCopy); 5885 _cache.put(unitSource, dartCopy);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
5924 _cache.put(source, htmlCopy); 5938 _cache.put(source, htmlCopy);
5925 htmlEntry = htmlCopy; 5939 htmlEntry = htmlCopy;
5926 } else { 5940 } else {
5927 logInformation2("Resolution results discarded for ${debuggingString(sour ce)}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTime = ${html Entry.modificationTime}", thrownException); 5941 logInformation2("Resolution results discarded for ${debuggingString(sour ce)}; sourceTime = ${sourceTime}, resultTime = ${resultTime}, cacheTime = ${html Entry.modificationTime}", thrownException);
5928 HtmlEntryImpl htmlCopy = htmlEntry.writableCopy; 5942 HtmlEntryImpl htmlCopy = htmlEntry.writableCopy;
5929 if (thrownException == null || resultTime >= 0) { 5943 if (thrownException == null || resultTime >= 0) {
5930 // 5944 //
5931 // The analysis was performed on out-of-date sources. Mark the cache s o that the sources 5945 // The analysis was performed on out-of-date sources. Mark the cache s o that the sources
5932 // will be re-analyzed using the up-to-date sources. 5946 // will be re-analyzed using the up-to-date sources.
5933 // 5947 //
5934 if (identical(htmlCopy.getState(HtmlEntry.ELEMENT), CacheState.IN_PROC ESS)) { 5948 // if (htmlCopy.getState(HtmlEntry.ELEMENT) == CacheState.IN_ PROCESS) {
5935 htmlCopy.setState(HtmlEntry.ELEMENT, CacheState.INVALID); 5949 // htmlCopy.setState(HtmlEntry.ELEMENT, CacheState.INVALID) ;
5936 } 5950 // }
5937 if (identical(htmlCopy.getState(HtmlEntry.RESOLUTION_ERRORS), CacheSta te.IN_PROCESS)) { 5951 // if (htmlCopy.getState(HtmlEntry.RESOLUTION_ERRORS) == Cach eState.IN_PROCESS) {
5938 htmlCopy.setState(HtmlEntry.RESOLUTION_ERRORS, CacheState.INVALID); 5952 // htmlCopy.setState(HtmlEntry.RESOLUTION_ERRORS, CacheStat e.INVALID);
5939 } 5953 // }
5954 htmlCopy.invalidateAllInformation();
5955 htmlCopy.modificationTime = sourceTime;
5940 } else { 5956 } else {
5941 // 5957 //
5942 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the 5958 // We could not determine whether the sources were up-to-date or out-o f-date. Mark the
5943 // cache so that we won't attempt to re-analyze the sources until ther e's a good chance 5959 // cache so that we won't attempt to re-analyze the sources until ther e's a good chance
5944 // that we'll be able to do so without error. 5960 // that we'll be able to do so without error.
5945 // 5961 //
5946 htmlCopy.recordResolutionError(); 5962 htmlCopy.recordResolutionError();
5947 } 5963 }
5948 htmlCopy.exception = thrownException; 5964 htmlCopy.exception = thrownException;
5949 _cache.put(source, htmlCopy); 5965 _cache.put(source, htmlCopy);
(...skipping 1920 matching lines...) Expand 10 before | Expand all | Expand 10 after
7870 // new Angular context 7886 // new Angular context
7871 if (node.getAttribute(_NG_APP) != null) { 7887 if (node.getAttribute(_NG_APP) != null) {
7872 _isAngular = true; 7888 _isAngular = true;
7873 visitModelDirectives(node); 7889 visitModelDirectives(node);
7874 } 7890 }
7875 // not Angular 7891 // not Angular
7876 if (!_isAngular) { 7892 if (!_isAngular) {
7877 return super.visitXmlTagNode(node); 7893 return super.visitXmlTagNode(node);
7878 } 7894 }
7879 // process node in separate name scope 7895 // process node in separate name scope
7880 _nameScope = _resolver.pushNameScope(); 7896 pushNameScope();
7881 try { 7897 try {
7882 parseEmbeddedExpressions3(node); 7898 parseEmbeddedExpressions3(node);
7883 // apply processors 7899 // apply processors
7884 for (NgProcessor processor in _processors) { 7900 for (NgProcessor processor in _processors) {
7885 if (processor.canApply(node)) { 7901 if (processor.canApply(node)) {
7886 processor.apply(this, node); 7902 processor.apply(this, node);
7887 } 7903 }
7888 } 7904 }
7889 // resolve expressions 7905 // resolve expressions
7890 resolveExpressions(node.expressions); 7906 resolveExpressions(node.expressions);
7891 // process children 7907 // process children
7892 return super.visitXmlTagNode(node); 7908 return super.visitXmlTagNode(node);
7893 } finally { 7909 } finally {
7894 _resolver.popNameScope(); 7910 popNameScope();
7895 } 7911 }
7896 } finally { 7912 } finally {
7897 _isAngular = wasAngular; 7913 _isAngular = wasAngular;
7898 } 7914 }
7899 } 7915 }
7900 7916
7901 /** 7917 /**
7902 * Creates new [LocalVariableElementImpl] with given type and identifier. 7918 * Creates new [LocalVariableElementImpl] with given type and identifier.
7903 * 7919 *
7904 * @param type the [Type] of the variable 7920 * @param type the [Type] of the variable
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
7964 */ 7980 */
7965 Expression parseExpression(String contents, int offset) => parseExpression2(co ntents, 0, contents.length, offset); 7981 Expression parseExpression(String contents, int offset) => parseExpression2(co ntents, 0, contents.length, offset);
7966 7982
7967 Expression parseExpression2(String contents, int startIndex, int endIndex, int offset) { 7983 Expression parseExpression2(String contents, int startIndex, int endIndex, int offset) {
7968 Token token = scanDart(contents, startIndex, endIndex, offset); 7984 Token token = scanDart(contents, startIndex, endIndex, offset);
7969 return parseExpression3(token); 7985 return parseExpression3(token);
7970 } 7986 }
7971 7987
7972 Expression parseExpression3(Token token) => ht.HtmlParser.parseEmbeddedExpress ion(_source, token, _errorListener); 7988 Expression parseExpression3(Token token) => ht.HtmlParser.parseEmbeddedExpress ion(_source, token, _errorListener);
7973 7989
7990 void popNameScope() {
7991 _nameScope = _resolver.popNameScope();
7992 }
7993
7994 void pushNameScope() {
7995 _nameScope = _resolver.pushNameScope();
7996 }
7997
7974 /** 7998 /**
7975 * Reports given [ErrorCode] at the given [ASTNode]. 7999 * Reports given [ErrorCode] at the given [ASTNode].
7976 */ 8000 */
7977 void reportError(ASTNode node, ErrorCode errorCode, List<Object> arguments) { 8001 void reportError(ASTNode node, ErrorCode errorCode, List<Object> arguments) {
7978 reportError7(node.offset, node.length, errorCode, arguments); 8002 reportError7(node.offset, node.length, errorCode, arguments);
7979 } 8003 }
7980 8004
7981 /** 8005 /**
7982 * Reports given [ErrorCode] at the given position. 8006 * Reports given [ErrorCode] at the given position.
7983 */ 8007 */
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
8032 } 8056 }
8033 8057
8034 /** 8058 /**
8035 * Puts into [resolver] an [ResolverVisitor] to resolve [Expression]s in 8059 * Puts into [resolver] an [ResolverVisitor] to resolve [Expression]s in
8036 * [source]. 8060 * [source].
8037 */ 8061 */
8038 void createResolver() { 8062 void createResolver() {
8039 InheritanceManager inheritanceManager = new InheritanceManager(_libraryEleme nt); 8063 InheritanceManager inheritanceManager = new InheritanceManager(_libraryEleme nt);
8040 _resolver = new ResolverVisitor.con2(_libraryElement, _source, _typeProvider , inheritanceManager, _errorListener); 8064 _resolver = new ResolverVisitor.con2(_libraryElement, _source, _typeProvider , inheritanceManager, _errorListener);
8041 _topNameScope = _resolver.pushNameScope(); 8065 _topNameScope = _resolver.pushNameScope();
8066 // add Scope variables - no type, no location, just to avoid warnings
8067 {
8068 Type2 type = _typeProvider.dynamicType;
8069 _topNameScope.define(createLocalVariable2(type, "\$id"));
8070 _topNameScope.define(createLocalVariable2(type, "\$parent"));
8071 _topNameScope.define(createLocalVariable2(type, "\$root"));
8072 }
8042 } 8073 }
8043 8074
8044 /** 8075 /**
8045 * Returns the external Dart script [Source] referenced by the given [HtmlUnit ]. 8076 * Returns the external Dart script [Source] referenced by the given [HtmlUnit ].
8046 */ 8077 */
8047 Source getDartSource(ht.HtmlUnit unit) { 8078 Source getDartSource(ht.HtmlUnit unit) {
8048 for (HtmlScriptElement script in unit.element.scripts) { 8079 for (HtmlScriptElement script in unit.element.scripts) {
8049 if (script is ExternalHtmlScriptElement) { 8080 if (script is ExternalHtmlScriptElement) {
8050 Source scriptSource = script.scriptSource; 8081 Source scriptSource = script.scriptSource;
8051 if (scriptSource != null) { 8082 if (scriptSource != null) {
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
8327 if (selector is HasAttributeSelectorElementImpl) { 8358 if (selector is HasAttributeSelectorElementImpl) {
8328 name = selector.name; 8359 name = selector.name;
8329 } 8360 }
8330 } 8361 }
8331 // resolve attribute expression 8362 // resolve attribute expression
8332 ht.XmlAttributeNode attribute = node.getAttribute(name); 8363 ht.XmlAttributeNode attribute = node.getAttribute(name);
8333 if (attribute != null) { 8364 if (attribute != null) {
8334 attribute.element = property; 8365 attribute.element = property;
8335 // resolve if binding 8366 // resolve if binding
8336 if (property.propertyKind != AngularPropertyKind.ATTR) { 8367 if (property.propertyKind != AngularPropertyKind.ATTR) {
8337 Expression expression = parseExpression(resolver, attribute); 8368 resolver.pushNameScope();
8338 resolver.resolveNode(expression); 8369 try {
8339 setExpression(attribute, expression); 8370 onNgEventDirective(resolver);
8371 Expression expression = parseExpression(resolver, attribute);
8372 resolver.resolveNode(expression);
8373 setExpression(attribute, expression);
8374 } finally {
8375 resolver.popNameScope();
8376 }
8340 } 8377 }
8341 } 8378 }
8342 } 8379 }
8343 } 8380 }
8344 8381
8345 bool canApply(ht.XmlTagNode node) => _element.selector.apply(node); 8382 bool canApply(ht.XmlTagNode node) => _element.selector.apply(node);
8383
8384 /**
8385 * Support for <code>$event</code> variable in <code>NgEventDirective</code>.
8386 */
8387 void onNgEventDirective(AngularHtmlUnitResolver resolver) {
8388 if (_element.isClass("NgEventDirective")) {
8389 Type2 dynamicType = resolver.typeProvider.dynamicType;
8390 resolver.defineVariable(resolver.createLocalVariable2(dynamicType, "\$even t"));
8391 }
8392 }
8346 } 8393 }
8347 8394
8348 /** 8395 /**
8349 * [NgDirectiveProcessor] describes any <code>NgDirective</code> annotation inst ance. 8396 * [NgDirectiveProcessor] describes any <code>NgDirective</code> annotation inst ance.
8350 */ 8397 */
8351 abstract class NgDirectiveProcessor extends NgProcessor { 8398 abstract class NgDirectiveProcessor extends NgProcessor {
8352 static ht.EmbeddedExpression newEmbeddedExpression(Expression e) => new ht.Emb eddedExpression(e.offset, e, e.end); 8399 static ht.EmbeddedExpression newEmbeddedExpression(Expression e) => new ht.Emb eddedExpression(e.offset, e, e.end);
8353 8400
8354 Expression parseExpression(AngularHtmlUnitResolver resolver, ht.XmlAttributeNo de attribute) { 8401 Expression parseExpression(AngularHtmlUnitResolver resolver, ht.XmlAttributeNo de attribute) {
8355 int offset = attribute.valueToken.offset + 1; 8402 int offset = attribute.valueToken.offset + 1;
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
9820 9867
9821 void logError3(Exception exception) { 9868 void logError3(Exception exception) {
9822 } 9869 }
9823 9870
9824 void logInformation(String message) { 9871 void logInformation(String message) {
9825 } 9872 }
9826 9873
9827 void logInformation3(String message, Exception exception) { 9874 void logInformation3(String message, Exception exception) {
9828 } 9875 }
9829 } 9876 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/element.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698