Paul Berry
2d3fe73b36
Fix tests of DartObject.hasKnownValue.
...
The tests were exercising the semantics of the old (deprecated) method
hasExactValue, and thus they were failing.
TBR=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1411083004 .
2015-10-19 07:32:54 -07:00
Brian Wilkerson
204ee60bd0
Add a public API for the results of constant evaluation
...
R=paulberry@google.com
Review URL: https://codereview.chromium.org/1410643003 .
2015-10-17 07:51:10 -07:00
Brian Wilkerson
40b38e988b
Include parameter annotations in toSource (issue 24578)
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1408923002 .
2015-10-16 07:41:05 -07:00
pq
888c4c526f
State-carrying context API.
...
R=brianwilkerson@google.com , scheglov@google.com
Review URL: https://codereview.chromium.org/1403033002 .
2015-10-14 15:33:09 -07:00
Sigurd Meldgaard
a763c71d92
Introduce the "Embedded" category.
...
It is not visible from the dart2js command line.
BUG=
R=brianwilkerson@google.com , johnniwinther@google.com
Committed: https://github.com/dart-lang/sdk/commit/0aef0efb6a38a65fa676fa9e8daa85a972521745
Reverted: https://codereview.chromium.org/1401513002
Review URL: https://codereview.chromium.org/1395863002 .
2015-10-12 12:15:48 +02:00
Konstantin Shcheglov
ebdfa991d4
Issue 24538. Route SDK results into SDK context DartWorkManager.
...
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24538
Review URL: https://codereview.chromium.org/1399873002 .
2015-10-09 21:45:35 -07:00
Paul Berry
9af099fcdf
Access types safely in TypeResolverVisior.visitMethodDeclaration()
...
Previously, when attempting to figure out the type of the synthetic
field associated with a getter (or setter),
TypeResolverVisitor.visitMethodDeclaration() used the getters
FunctionTypeImpl.returnType (or FunctionTypeImpl.normalParameterTypes)
to extract the appropriate type. But those getters are only safe to
use after types have been fully constructed (because they may try to
perform type substitution). Fortunately, type substitution isn't
needed here, so we can simply use FunctionTypeImpl.baseReturnType (or
FunctionTypeImpl.baseParameters) instead.
Fixes #24539 .
R=brianwilkerson@google.com , scheglov@google.com
Review URL: https://codereview.chromium.org/1397193002 .
2015-10-09 14:21:12 -07:00
Konstantin Shcheglov
14ab3cae4d
Fix for top level variable documention ranges.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org/1396693004 .
2015-10-09 10:39:46 -07:00
Konstantin Shcheglov
4e6195fdf5
Issue 24514. Set documentation range for LibraryElement.
...
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24514
Review URL: https://codereview.chromium.org/1390003002 .
2015-10-06 16:13:57 -07:00
Konstantin Shcheglov
ef434d6a9b
Issue 24503. Disable type overrides for properties.
...
R=brianwilkerson@google.com , paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/24503
Review URL: https://codereview.chromium.org/1386033003 .
2015-10-06 08:40:02 -07:00
Konstantin Shcheglov
c4427ca8f4
Fix for incremental resolver - changing field formal parameter name is sometimes a non-incremental change.
...
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1374313007 .
2015-10-06 08:35:07 -07:00
Brian Wilkerson
04c5a5f199
Clean up hints
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1382403002 .
2015-10-05 09:20:44 -07:00
Konstantin Shcheglov
0ff03b00b8
Add the 'docRange' property and use it to compute documentation comment.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org/1376473007 .
2015-10-02 15:13:30 -07:00
John Messerly
a8570d9e7c
fixes strong mode assignability
...
this fixes https://github.com/dart-lang/dev_compiler/issues/356
The issue here is that StrongTypeSystemImpl has toType and fromType backwards from how they are defined on the base class.
The way it works is to read it as "is the first type assignable to the second type"?
(I can see how this may have happened: the base class uses "leftType" and "rightType", which refers to the parameter order, not the order they would appear in an assignment expression.)
R=leafp@google.com
Review URL: https://codereview.chromium.org//1380963004 .
2015-10-01 15:40:50 -07:00
Konstantin Shcheglov
1d28f99524
Fix for 'implemented' notification after an incremental change.
...
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org//1374943005 .
2015-09-30 11:08:41 -07:00
John Messerly
20e1f91fbb
fix inference of hashCode with library prefix
...
fixes https://github.com/dart-lang/dev_compiler/issues/349
R=leafp@google.com
Review URL: https://codereview.chromium.org//1374813002 .
2015-09-28 16:02:10 -07:00
John Messerly
253fc292cb
fix inference of object members on library prefix
...
See https://github.com/dart-lang/dev_compiler/issues/349 for context.
The prefix fix handled `toString()` but not `library_prefix.toString()`
R=brianwilkerson@google.com , leafp@google.com
Review URL: https://codereview.chromium.org//1374773003 .
2015-09-28 14:40:20 -07:00
John Messerly
c09b338e25
fix inference of object members when a method has no target
...
we incorrectly thought `toString()` was a call to `Object.toString()`
See https://github.com/dart-lang/dev_compiler/issues/349 for more context
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1368793004 .
2015-09-25 17:22:56 -07:00
Konstantin Shcheglov
3924b15d85
Remove ElementLocator.locateWithOffset altogether.
...
It was needed only for the old Angular implementation support, which
overlayed its own Element subclasses into normal Dart AST, for example
for string literals - names of components.
As we don't support this anymore, there is no need for the method.
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1370833002 .
2015-09-25 14:57:15 -07:00
Konstantin Shcheglov
6c029f9cb1
Issue 24440. Fix for renaming libraries using 'part of' directives.
...
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24440
Review URL: https://codereview.chromium.org//1364853007 .
2015-09-25 14:24:05 -07:00
Leaf Petersen
ff86501c85
This adds support for a DDC special case of inline JS. It also addresses an issue from an earlier CL, makes some readability improvements, and eliminates some now-redundant TODOs.
...
BUG=
R=scheglov@google.com , vsm@google.com
Review URL: https://codereview.chromium.org//1355393003 .
2015-09-23 08:58:04 -07:00
Leaf Petersen
4fe661995d
Add additional strong mode inference. This adds in all the remaining inference cases from the strong mode RestrictedStaticTypeAnalyzer.
...
BUG=
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1352763004 .
2015-09-22 14:03:08 -07:00
pq
f02dd6b82c
Unused import cleanup.
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1349393004 .
2015-09-22 09:49:16 -07:00
Konstantin Shcheglov
3aabaa96e6
Fix for a stupid copy/paste bug in the incremental resolver.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1360583003 .
2015-09-21 09:17:35 -07:00
Konstantin Shcheglov
fcb0c319da
Fix for updating HINTS during incremental resolution with TM.
...
The key change is not updating LIBRARY_UNIT_ERRORS in IncrementalResolver.
Otherwise it becomes VALID and we don't recompute it, so don't recompute HINTS.
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1355503004 .
2015-09-18 13:41:09 -07:00
Leaf Petersen
f912eabcbf
Make type system changes backwards compatible
...
This CL eliminates the additional typeSystem arguments added to the API by https://codereview.chromium.org/1329743005/ wherever possible, instead projecting out the typeSystem from the context as available. Where not possible, the additional argument is made optional, defaulting to the standard TypeSystemImpl. I believe that the result of this should be backwards compatible for clients (but not implementors) of the API.
BUG=
R=brianwilkerson@google.com , paulberry@google.com
Review URL: https://codereview.chromium.org//1355773002 .
2015-09-18 09:59:12 -07:00
Harry Terkelsen
f4426b109b
Do not emit semicolons for await expressions in ToSourceVisitor
...
Closes #24364
BUG=
R=brianwilkerson@google.com , scheglov@google.com
Review URL: https://codereview.chromium.org//1345403002 .
2015-09-17 11:20:45 -07:00
Leaf Petersen
a19bd39da8
First cut at abstracting over the type system. This factors out uses of isAssignableTo and isSubtypeOf into calls through a type system object. Currently there is only one kind of type system, which just falls over to the existing implementations.
...
BUG=
R=brianwilkerson@google.com , paulberry@google.com
Review URL: https://codereview.chromium.org//1329743005 .
2015-09-16 14:55:59 -07:00
Brian Wilkerson
5b925adf82
Addition bug fixes for new task model
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1331843004 .
2015-09-10 08:10:29 -07:00
Brian Wilkerson
4797c5fecc
Fix incremental resolution tests
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1318943006 .
2015-09-09 10:03:51 -07:00
Brian Wilkerson
24b24a3569
Reformat code to reduce churn
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1322513004 .
2015-09-09 08:19:41 -07:00
Brian Wilkerson
de51d0ab45
Improve failure message
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1315233007 .
2015-09-08 15:07:15 -07:00
Brian Wilkerson
8b9c5f231e
Remove unneeded test
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1310593004 .
2015-09-08 13:24:09 -07:00
Brian Wilkerson
5efe30d458
Stop propagating return types for top-level function declarations
...
R=paulberry@google.com , scheglov@google.com
Review URL: https://codereview.chromium.org//1309243007 .
2015-09-08 13:14:36 -07:00
Paul Berry
5ea1238b56
Fix handling of shortcutting expressions and asserts in ExitDetector.
...
Fixes #24293 .
Fixes #24294 .
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1331433003 .
2015-09-07 12:23:33 -07:00
Leaf Petersen
f90c09df48
Strong mode foreach inference. Infer the type of declared identifiers
...
in foreach blocks.
BUG=
R=brianwilkerson@google.com , paulberry@google.com
Review URL: https://codereview.chromium.org//1323513005 .
2015-09-01 17:37:58 -07:00
Konstantin Shcheglov
3e9645af53
Resolve enum documentation comments.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1325513004 .
2015-08-28 14:07:13 -07:00
Konstantin Shcheglov
3d1da0f320
Add AnalysisContext.getResult()/computeResult()
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1308033008 .
2015-08-28 13:57:25 -07:00
Leaf Petersen
bff9b65509
Strong mode local variable inference
...
BUG=
R=brianwilkerson@google.com , paulberry@google.com
Review URL: https://codereview.chromium.org//1314793005 .
2015-08-27 13:27:10 -07:00
Konstantin Shcheglov
597f189eb4
Extension point for WorkManagerFactory(s).
...
I'm not quite happy that internal classes get into the extension point declaration.
But I guess that because of the nature of the work WorkManager(s) are doing, we have to have significant exposure to internals.
Also, onAnalysisOptionsChanged() and onSourceFactoryChanged()... these probably are better to implement as streams in InternalAnalysisContext.
Thoughts?
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org//1311773005 .
2015-08-26 09:45:19 -07:00
Paul Berry
b547acc883
Band-aid fix for issue #24191 .
...
This is sufficient to avoid throwing an exception in the resolver,
which in turn will prevent the analysis server from going into an
infinite analysis loop.
I'll work on a more complete fix (which infers the proper type in all
cases) for the next release.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1307353002 .
2015-08-24 16:05:05 -07:00
Konstantin Shcheglov
581e20d2f6
Disable incremental resolution for not BlockFunctionBody(s).
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//1310073002 .
2015-08-22 10:04:53 -07:00
pq
67e988bb9f
No more warnings for duplicate unnamed lib imports
...
Fixes #24156 .
R=brianwilkerson@google.com , paulberry@google.com
Review URL: https://codereview.chromium.org//1305433005 .
2015-08-20 14:30:37 -07:00
pq
e11ce8ba87
Handle comparison of empty URIs (sdk/24126).
...
Fixes issue where `.packages` provides a key mapped to an empty value (https://github.com/dart-lang/sdk/issues/24126 ).
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1298393004 .
2015-08-19 12:53:55 -07:00
pq
a428c4607a
Disable dart2js hints by default.
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1289273005 .
2015-08-18 13:04:13 -07:00
Paul Berry
8f2ed2c68d
Fix most implementations of UriResolver.restoreAbsolute.
...
Although it wasn't previously clear in the documentation,
implementations of UriResolver.restoreAbsolute() should only depend on
Source.fullName. To do otherwise breaks some assumptions made by
analysis server. This CL fixes all implementations except
SdkExtUriResolver (which has been deferred to issue #24090 ).
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1296653003 .
2015-08-18 11:32:15 -07:00
Brian Wilkerson
81fbf6af7c
Initial steps toward adding strong mode to the new task model
...
R=leafp@google.com , scheglov@google.com
Review URL: https://codereview.chromium.org//1289283004 .
2015-08-17 17:07:50 -07:00
John Messerly
6417c36b0a
[analyzer] remove "auto-generated do not edit" comments
...
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1291143002 .
2015-08-13 13:36:02 -07:00
danrubel
da92573117
fix sorting of compilation unit members - related to #23947
...
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//1281793004 .
2015-08-11 14:24:37 -04:00
Brian Wilkerson
913524d12d
Possible fix for tests failing on the Windows bots
...
R=paulberry@google.com
Review URL: https://codereview.chromium.org//1282823004 .
2015-08-10 13:59:38 -07:00