Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
240 commits
Select commit Hold shift + click to select a range
dff1450
Gather expressions from javascript & typescript
Maximilian-Seitz Oct 25, 2019
e8302c9
Gather function blocks to proto. Fix property initializers in tests
Maximilian-Seitz Oct 28, 2019
76715d6
Convert function bodies to typescript model
Maximilian-Seitz Oct 28, 2019
116e33d
Fix operator conversion to string
Maximilian-Seitz Oct 28, 2019
e39ddf8
Fix return statement conversion
Maximilian-Seitz Oct 28, 2019
3dbfa4d
Add simple type analysis
Maximilian-Seitz Oct 28, 2019
d906f14
Delete javascript test
Maximilian-Seitz Oct 29, 2019
c2fbceb
Merge branch 'typescript-ast' into types
Maximilian-Seitz Oct 29, 2019
025cb8e
Formatting
Maximilian-Seitz Oct 29, 2019
a43dfbf
Merge branch 'typescript-ast' into types
Maximilian-Seitz Oct 29, 2019
4b830f1
Formatting
Maximilian-Seitz Oct 29, 2019
3447e1b
Merge branch 'typescript-ast' into types
Maximilian-Seitz Oct 29, 2019
96ee0fc
Introduce constraints to define types in steps
Maximilian-Seitz Oct 29, 2019
a01559d
Remove debug comments
Maximilian-Seitz Oct 29, 2019
d694fdd
Correctly evaluate binary operator return types
Maximilian-Seitz Oct 29, 2019
0e0dd36
Add 'unknown' expression in TS AST, to allow access to source code text
Maximilian-Seitz Oct 29, 2019
f807081
Remove wrongly implied 'null' in optional parameters (without explici…
Maximilian-Seitz Oct 30, 2019
811c71a
Remove wrongly implied 'null' in optional parameters (without explici…
Maximilian-Seitz Oct 30, 2019
a656a45
Merge branch 'typescript-ast' of https://github.com/Maximilian-Seitz/…
Maximilian-Seitz Oct 30, 2019
7a4569a
Merge branch 'typescript-ast' into types
Maximilian-Seitz Oct 30, 2019
8b1d082
Move expression conversion to seperate classes from 'AstConverter' an…
Maximilian-Seitz Oct 30, 2019
f59346e
Merge branch 'typescript-ast' into types
Maximilian-Seitz Oct 30, 2019
c47ebd8
Resolve constraints with explicit types
Maximilian-Seitz Oct 30, 2019
26f6828
Convert boolean literals to TS AST
Maximilian-Seitz Oct 30, 2019
4bb9093
Merge branch 'typescript-ast' into types
Maximilian-Seitz Oct 30, 2019
7a36fde
Gather type constraint from boolean literal expression
Maximilian-Seitz Oct 30, 2019
6b23560
Filter expression statements from lowerings
Maximilian-Seitz Oct 30, 2019
5911f77
Merge branch 'typescript-ast' into types
Maximilian-Seitz Oct 30, 2019
823015c
Convert unary expression
Maximilian-Seitz Oct 30, 2019
69d48a1
Merge branch 'typescript-ast' into types
Maximilian-Seitz Oct 30, 2019
a3ca990
Store constraints for function parameters
Maximilian-Seitz Oct 30, 2019
e3817e6
Get constrains from unary expressions
Maximilian-Seitz Oct 30, 2019
46b88f2
Track constraints for variables throughout function body
Maximilian-Seitz Oct 31, 2019
c517961
Merge remote-tracking branch 'upstream/master' into typescript-ast
Maximilian-Seitz Oct 31, 2019
5368477
Add js-interpretation module
Maximilian-Seitz Oct 31, 2019
0bfc563
Merge branch 'typescript-ast' into types
Maximilian-Seitz Oct 31, 2019
e5acd62
Make BlockDelcaration hold TopLevelDeclarations, instead of TopLevelE…
Maximilian-Seitz Oct 31, 2019
cff838a
Merge branch 'typescript-ast' into types
Maximilian-Seitz Oct 31, 2019
be5c524
Fix BlockDeclaration containing TopLevelDeclarations, instead of TopL…
Maximilian-Seitz Oct 31, 2019
ad27139
Introduce types in interface members
Maximilian-Seitz Oct 31, 2019
250bb83
Convert variable initializers
Maximilian-Seitz Oct 31, 2019
b43d29f
Merge branch 'typescript-ast' into types
Maximilian-Seitz Oct 31, 2019
ae900c6
Track type constraints of variables created in function bodies
Maximilian-Seitz Oct 31, 2019
f88c574
Change use of .javaClass to ::class
Maximilian-Seitz Oct 31, 2019
72b5af2
Merge remote-tracking branch 'upstream/master' into typescript-ast
Maximilian-Seitz Nov 4, 2019
83e4e86
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 4, 2019
9bd42bd
Merge remote-tracking branch 'upstream/master' into typescript-ast
Maximilian-Seitz Nov 5, 2019
cdfcc09
Add qualifier expressions
Maximilian-Seitz Nov 5, 2019
7266a46
Add PropertyAccessExpressionDeclaration and ElementAccessExpressionDe…
Maximilian-Seitz Nov 5, 2019
633fdce
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 5, 2019
aac8bb0
Allow references in functions, to outside scope
Maximilian-Seitz Nov 6, 2019
b78a06d
Add typeof expression
Maximilian-Seitz Nov 6, 2019
24e00d3
Merge remote-tracking branch 'upstream/master' into typescript-ast
Maximilian-Seitz Nov 6, 2019
c69efc1
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 6, 2019
b587ae3
Support typeof expression
Maximilian-Seitz Nov 6, 2019
1d97769
Make type analysis from boolean operations more accurate
Maximilian-Seitz Nov 6, 2019
58bbf29
Add boolean as return type for 'in' operator
Maximilian-Seitz Nov 6, 2019
06d3cbe
Analyze additional operators
Maximilian-Seitz Nov 7, 2019
5d87de7
Seperate JS and TS translation. Add JS translation test.
Maximilian-Seitz Nov 7, 2019
8b1b908
Remove export modifiers from JS test
Maximilian-Seitz Nov 7, 2019
777f4f5
Add call expression
Maximilian-Seitz Nov 7, 2019
ca898b6
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 7, 2019
b54017c
Derive types from called functions
Maximilian-Seitz Nov 7, 2019
c885f6e
Fix regex literal expression protobuf conversion
Maximilian-Seitz Nov 7, 2019
6606371
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 7, 2019
8c4e966
Remove need of 'ConstraintContainer', instead having each constraint …
Maximilian-Seitz Nov 8, 2019
3d1b891
Split up tests
Maximilian-Seitz Nov 8, 2019
d9b1ebf
Keep track of types through property access
Maximilian-Seitz Nov 8, 2019
3338ba4
Allow access to properties in references outside of scope
Maximilian-Seitz Nov 8, 2019
c92a036
Add tests for properties in references
Maximilian-Seitz Nov 8, 2019
8347277
Extract unit functions into their own test
Maximilian-Seitz Nov 11, 2019
d7b3f0f
Make extension function for calculating constraints for expressions n…
Maximilian-Seitz Nov 11, 2019
439abd6
Add TODO for CallResultConstraint, to make it mutable
Maximilian-Seitz Nov 11, 2019
656d989
Support object literal expressions
Maximilian-Seitz Nov 11, 2019
f406eb5
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 11, 2019
b3324b9
Unify object literal, and object type members
Maximilian-Seitz Nov 11, 2019
9895845
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 11, 2019
a74051c
Add initializer to PropertyDeclaration
Maximilian-Seitz Nov 11, 2019
e8681db
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 11, 2019
aba41d0
Gather object types
Maximilian-Seitz Nov 11, 2019
035b908
Make operators more aggressive
Maximilian-Seitz Nov 11, 2019
d6a1a64
Add infrastructure to process variations in a branching code block
Maximilian-Seitz Nov 12, 2019
4178e59
Add if-statement
Maximilian-Seitz Nov 12, 2019
6704693
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 12, 2019
50481cd
Support if-statements (only taking first path for now)
Maximilian-Seitz Nov 12, 2019
372a4f2
Track modification of function results
Maximilian-Seitz Nov 13, 2019
630f757
Add test to modify function result
Maximilian-Seitz Nov 13, 2019
bd566b7
Support functions with multiple return types
Maximilian-Seitz Nov 13, 2019
3da4261
Merge remote-tracking branch 'upstream/master' into typescript-ast
Maximilian-Seitz Nov 13, 2019
036d39d
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 13, 2019
7db1f54
Add block statement
Maximilian-Seitz Nov 13, 2019
1e1c3bb
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 13, 2019
6c90472
Add block as 'then' and 'else' statements in conditional test
Maximilian-Seitz Nov 13, 2019
0d7c010
Fix crash when else-statement in if-statement doesn't exist
Maximilian-Seitz Nov 13, 2019
1035d19
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 13, 2019
62099c8
Change conditional test to include if-statement without else-block
Maximilian-Seitz Nov 13, 2019
476185e
Properly resolve property access to expressions other than identifier…
Maximilian-Seitz Nov 13, 2019
4d4eb94
Simplify test
Maximilian-Seitz Nov 13, 2019
a71952d
Remove debug output
Maximilian-Seitz Nov 13, 2019
ce36ba3
Make union type with single type not dynamic (use the single type ins…
Maximilian-Seitz Nov 13, 2019
d3c5c53
Change unknown types to Any?, instead of Unit
Maximilian-Seitz Nov 13, 2019
1d5147d
Allow functions as return types
Maximilian-Seitz Nov 13, 2019
b6dbe69
Block function branches, in which they execute themselves, from being…
Maximilian-Seitz Nov 14, 2019
86d8604
Remove recursive constraints at resolution
Maximilian-Seitz Nov 14, 2019
ad48702
Improve operator type analysis behaviour for comparisons
Maximilian-Seitz Nov 14, 2019
ba100d4
Add while statement
Maximilian-Seitz Nov 14, 2019
02e9546
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 14, 2019
c11923b
Go through while loops once, and not at all (as alternative paths)
Maximilian-Seitz Nov 14, 2019
db1ee97
Add new expression
Maximilian-Seitz Nov 14, 2019
db0221f
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 14, 2019
6c2b461
Remove 'propertyNames' property from 'PropertyOwner' interface
Maximilian-Seitz Nov 14, 2019
f6d2eb8
Track object instantiation
Maximilian-Seitz Nov 15, 2019
45c5cef
Merge remote-tracking branch 'upstream/master' into typescript-ast
Maximilian-Seitz Nov 15, 2019
81da60b
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 15, 2019
79b1286
Refractor declaration proto
Maximilian-Seitz Nov 15, 2019
e4ead22
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 15, 2019
da86141
Add various declarations to typescript protobuf. Refractor protobuf.
Maximilian-Seitz Nov 15, 2019
dda90e8
Add typescript declarations for AST protobuf
Maximilian-Seitz Nov 18, 2019
6cc63a2
Merge remote-tracking branch 'upstream/master' into typescript-ast-proto
Maximilian-Seitz Nov 19, 2019
3c3e37c
Merge branch 'typescript-ast-proto-ts' into typescript-ast-proto
Maximilian-Seitz Nov 19, 2019
249ae6e
Fix scopes used for resolving references.
Maximilian-Seitz Nov 20, 2019
098eb07
Move 'calculateConstraint' and 'addTo' to a seperate file
Maximilian-Seitz Nov 20, 2019
02a5247
Restrict exports to CommonJS compatible exports
Maximilian-Seitz Nov 20, 2019
00a1e8a
Fix properties being static when they shouldn't be, and the other way…
Maximilian-Seitz Nov 20, 2019
a051cb1
Merge remote-tracking branch 'upstream/master' into typescript-ast
Maximilian-Seitz Nov 20, 2019
e6d9ab4
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 20, 2019
455071b
Minor fixes
Maximilian-Seitz Nov 20, 2019
2822bc1
Resolve certain constraints only once, and store the result.
Maximilian-Seitz Nov 21, 2019
cbd30dd
Fix out of bounds error, when evaluating function call with more argu…
Maximilian-Seitz Nov 21, 2019
5698b06
Merge branch 'typescript-ast-proto' into typescript-ast
Maximilian-Seitz Nov 21, 2019
96b58f8
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 21, 2019
6204175
Add function and class expressions
Maximilian-Seitz Nov 21, 2019
8e61087
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 21, 2019
4fe3035
Support function and class expressions
Maximilian-Seitz Nov 21, 2019
a067daa
Build CommonJS environment on top of default environment
Maximilian-Seitz Nov 21, 2019
1c289cf
Remove unneeded imports
Maximilian-Seitz Nov 21, 2019
d2ca164
Remove unneeded dead code
Maximilian-Seitz Nov 21, 2019
cd40b8f
Fix crash when converting 'new' expression without argument block for…
Maximilian-Seitz Nov 21, 2019
b25be08
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 21, 2019
273eb02
Treat prototype functions as classes
Maximilian-Seitz Nov 21, 2019
a070f87
Add constructor body
Maximilian-Seitz Nov 21, 2019
327dd85
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 21, 2019
b9c1ede
Handle constructor for prototype functions, and make functions with p…
Maximilian-Seitz Nov 22, 2019
1f5560f
Add tests for functions with properties and prototype functions
Maximilian-Seitz Nov 25, 2019
189f23d
Merge remote-tracking branch 'upstream/master' into typescript-ast
Maximilian-Seitz Nov 25, 2019
3e30eed
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 25, 2019
282c890
Add array literal expressions
Maximilian-Seitz Nov 25, 2019
0854d64
Merge branch 'typescript-ast' into types
Maximilian-Seitz Nov 25, 2019
3355871
Add conditional expression
Maximilian-Seitz Dec 2, 2019
d1d684f
Merge branch 'typescript-ast' into types
Maximilian-Seitz Dec 2, 2019
541612b
Support conditional expression
Maximilian-Seitz Dec 2, 2019
16e969c
Fix test
Maximilian-Seitz Dec 2, 2019
0d11075
Restrict types for arguments, based on properties accessed of type.
Maximilian-Seitz Dec 3, 2019
58d2705
Differentiate type passed into a function, and type after modificatio…
Maximilian-Seitz Dec 3, 2019
48efc9d
Delete unneeded test
Maximilian-Seitz Dec 3, 2019
74bddba
Fix implied type of boolean, when using value as condition
Maximilian-Seitz Dec 3, 2019
5752599
Fix constraints not being resolved in certain situations
Maximilian-Seitz Dec 3, 2019
6c051a4
Merge remote-tracking branch 'upstream/master' into typescript-ast
Maximilian-Seitz Dec 3, 2019
2e7e014
Merge branch 'typescript-ast' into types
Maximilian-Seitz Dec 3, 2019
3fdc947
Resolve properties of arguments as arguments themselves
Maximilian-Seitz Dec 3, 2019
389048c
Convert arrow functions as functions without name, and single return …
Maximilian-Seitz Dec 3, 2019
f6bf6a3
Merge branch 'typescript-ast' into types
Maximilian-Seitz Dec 3, 2019
c72a774
Add simple test for property access of function argument
Maximilian-Seitz Dec 4, 2019
3bf5ad3
Remove outdated TODOs
Maximilian-Seitz Dec 4, 2019
2410b6d
Remove outdated TODOs
Maximilian-Seitz Dec 4, 2019
68f6726
Unify ExportResolver and EnvironmentProvider into TypeAnalysisContext
Maximilian-Seitz Dec 4, 2019
eddd8c7
Fix modifications to reference not always being tracked
Maximilian-Seitz Dec 5, 2019
27e009c
Remove redundant test case
Maximilian-Seitz Dec 5, 2019
d1adb89
Add test for modifying an object through a reference gotten from a fu…
Maximilian-Seitz Dec 5, 2019
70ad384
Resolve constraints received from functions, in order to not modify t…
Maximilian-Seitz Dec 5, 2019
01283cb
Add test for arrow functions
Maximilian-Seitz Dec 5, 2019
037c2b6
Add test for function with parameter with optional property
Maximilian-Seitz Dec 5, 2019
0d126f8
Merge function types with different parameter names
Maximilian-Seitz Dec 6, 2019
bd28536
Add throw statement
Maximilian-Seitz Dec 6, 2019
1031f1f
Merge branch 'typescript-ast' into types
Maximilian-Seitz Dec 6, 2019
62b6422
Track functions without ordinary return (by exception)
Maximilian-Seitz Dec 6, 2019
42e8e14
Add tests for functions throwing errors
Maximilian-Seitz Dec 6, 2019
158cc6c
Merge remote-tracking branch 'upstream/master' into typescript-ast
Maximilian-Seitz Dec 6, 2019
76d2775
Track invocation of arguments, and the types of the return values of …
Maximilian-Seitz Dec 9, 2019
7a61c63
Fix default exports, nameing them after the converted resource.
Maximilian-Seitz Dec 12, 2019
dadeef8
Add test for default function export
Maximilian-Seitz Dec 12, 2019
1403715
Merge remote-tracking branch 'upstream/master' into typescript-ast
Maximilian-Seitz Dec 12, 2019
ee1f5c6
Fix typescript header generation for typescript declaration protobuf
Maximilian-Seitz Dec 12, 2019
be5a96c
Merge branch 'typescript-ast' into types
Maximilian-Seitz Dec 12, 2019
2ce2265
Merge branch 'types' into merge-unions
Maximilian-Seitz Dec 12, 2019
ff6f950
Fix test to properly analyze throw statement
Maximilian-Seitz Dec 12, 2019
f260494
Remove unused code
Maximilian-Seitz Dec 12, 2019
b971ff6
Handle function with properties as default export properly
Maximilian-Seitz Dec 16, 2019
b697c74
Add test for function with properties as default export
Maximilian-Seitz Dec 16, 2019
4c5c0ea
Merge branch 'types' into merge-unions
Maximilian-Seitz Dec 16, 2019
5c4ba73
Merge basic types, so that comparison for more complex ones works cor…
Maximilian-Seitz Dec 16, 2019
f1092b5
Fix test for lambda argument with different names
Maximilian-Seitz Dec 17, 2019
1d7341b
Rename 'mergeUnions' to 'mergeDuplicates'
Maximilian-Seitz Dec 17, 2019
c9586c0
Track different overloads of functions, rather than a single function…
Maximilian-Seitz Dec 17, 2019
fa7cd22
Rename 'FunctionConstraint.Version' to 'FunctionConstraint.Overload'
Maximilian-Seitz Dec 17, 2019
fb70b1b
Track function overloads seperately, if valid.
Maximilian-Seitz Dec 27, 2019
08388c4
Fix duplicate UIDs in call-signature overloads
Maximilian-Seitz Dec 27, 2019
f1f6cc1
Remove outdated TODO
Maximilian-Seitz Dec 30, 2019
aaed11f
Merge branch 'master' into typescript-ast
Maximilian-Seitz Dec 30, 2019
8195f59
Merge branch 'typescript-ast' into types
Maximilian-Seitz Dec 30, 2019
e09658c
Removed unused import
Schahen Dec 30, 2019
bf67da4
Merge branch 'master' into JSInterop_WITH_M
Schahen Dec 30, 2019
d14188d
Make links navigatable in CoreSetCliTests and CoreSetTests
Schahen Dec 31, 2019
8e46200
REF: remove redundant merge duplicates
Schahen Jan 2, 2020
a3c2e8b
REF: FunctionDeclaration::removeUnneededAndReturnType => FunctionDecl…
Schahen Jan 2, 2020
4e6bd62
REF: removeUnneeded.kt => normalize
Schahen Jan 2, 2020
0f9591e
REF: use IRRELEVANT_UID in normalized declarations
Schahen Jan 2, 2020
7d39973
REF: introduce IRRELEVANT_TYPE
Schahen Jan 2, 2020
57b4276
REF: use rasieConcent in IRRELEVANT_TYPE getters
Schahen Jan 2, 2020
535fc4d
REF: susbtiteType while normalization
Schahen Jan 2, 2020
7ed8d4b
private fun List<FunctionDeclaration>.combinedReturnType(): Parameter…
Schahen Jan 2, 2020
077bc2f
REF: reintroduceUIDs has optional uid param
Schahen Jan 2, 2020
6aa688e
Use UUID for random uid generation
Schahen Jan 2, 2020
d1bdd90
in List<FunctionDeclaration>.mergeFunctions() we don't need to reintr…
Schahen Jan 2, 2020
d42f86f
in List<CallSignatureDeclaration>.mergeCallSignatures() we don't need…
Schahen Jan 2, 2020
33cbfa2
remove reintroduceUIDs and getNewUID
Schahen Jan 2, 2020
2c3c525
uid.kt => generateUID and using UUID.randomUUID().toString()
Schahen Jan 2, 2020
4245bcc
Introduce FunctionLikeDeclaration and maked FunctionDeclaration and C…
Schahen Jan 2, 2020
ae79ab6
Use combinedReturnType in List<CallSignatureDeclaration>.mergeCallSi…
Schahen Jan 2, 2020
cda9536
raiseConcern for Interface and ModuleDeclarations
Schahen Jan 2, 2020
0a174ec
Direction.Left and Direction.Right instead of First and Second
Schahen Jan 2, 2020
e913c79
idiomatic nonEmpty check in PathDescriptor
Schahen Jan 2, 2020
639ae9e
Use optional call instead of unsafe type case body.calculateConstraints
Schahen Jan 2, 2020
3a7d9fb
Use idyomatic ?.let as return type for something that otherwise retur…
Schahen Jan 2, 2020
f66f7db
renamed underscored packages to camelCased ones
Schahen Jan 2, 2020
55d4420
Remove unused code
Schahen Jan 2, 2020
2d476f4
Fix some duplicates not being merged correctly
Maximilian-Seitz Jan 3, 2020
a29abf2
Merge remote-tracking branch 'upstream/master' into JSInterop
Maximilian-Seitz Jan 7, 2020
0fba224
Merge branch 'types' into JSInterop
Maximilian-Seitz Jan 7, 2020
1e5eec4
Add tests for PathWalker
Maximilian-Seitz Jan 7, 2020
babaf46
Merge branch 'master' into typescript-ast
Maximilian-Seitz Jan 7, 2020
6966a27
Merge branch 'typescript-ast' into types
Maximilian-Seitz Jan 7, 2020
195d673
Normalize properties correctly, when mergeing duplicates
Maximilian-Seitz Jan 8, 2020
13cf936
Merge duplicates within types of properties (for example within unions)
Maximilian-Seitz Jan 8, 2020
1fdb6ae
Merge branch 'master' into types
Maximilian-Seitz Jan 8, 2020
553a091
Merge remote-tracking branch 'upstream/master'
Maximilian-Seitz Jan 9, 2020
672b510
Resolve class instance members correctly
Maximilian-Seitz Jan 9, 2020
a80580d
Merge remote-tracking branch 'upstream/master'
Maximilian-Seitz Jan 9, 2020
bf02f46
Merge remote-tracking branch 'upstream/master'
Maximilian-Seitz Jan 22, 2020
09887e9
Merge branch 'master' into object-member-resolution
Maximilian-Seitz Jan 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,19 @@ class ObjectConstraint(
val instantiatedClass: PropertyOwnerConstraint? = null
) : PropertyOwnerConstraint(owner) {
val propertyNames: Set<String>
get() = properties.keys
get() {
val names = properties.keys.toMutableSet()

if (instantiatedClass is PropertyOwner) {
val classPrototype = instantiatedClass["prototype"]

if (classPrototype is ObjectConstraint) {
names.addAll(classPrototype.propertyNames)
}
}

return names
}

private val properties = LinkedHashMap<String, Constraint>()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,6 @@ private fun ObjectConstraint.mapMembers() : List<MemberDeclaration> {
}
)

if (instantiatedClass is PropertyOwner) {
val classPrototype = instantiatedClass["prototype"]

if (classPrototype is ObjectConstraint) {
members.addAll(classPrototype.mapMembers())
}
}

return members
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import org.jetbrains.dukat.tsmodel.FunctionLikeDeclaration
import org.jetbrains.dukat.tsmodel.MemberDeclaration
import org.jetbrains.dukat.tsmodel.ModuleDeclaration
import org.jetbrains.dukat.tsmodel.ParameterDeclaration
import org.jetbrains.dukat.tsmodel.PropertyDeclaration
import org.jetbrains.dukat.tsmodel.SourceFileDeclaration
import org.jetbrains.dukat.tsmodel.SourceSetDeclaration
import org.jetbrains.dukat.tsmodel.TopLevelDeclaration
Expand Down Expand Up @@ -133,6 +134,7 @@ private fun List<MemberDeclaration>.mergeMembers() : List<MemberDeclaration> {
is ConstructorDeclaration -> constructors += member.mergeDuplicates()
is FunctionDeclaration -> methods += member.mergeDuplicates()
is CallSignatureDeclaration -> callSignatures += member.mergeDuplicates()
is PropertyDeclaration -> otherMembers += member.mergeDuplicates()
else -> otherMembers += member
}
}
Expand All @@ -151,6 +153,10 @@ private fun ParameterDeclaration.mergeDuplicates() = copy(
type = type.mergeDuplicates()
)

private fun PropertyDeclaration.mergeDuplicates() = copy(
type = type.mergeDuplicates()
)

private fun ConstructorDeclaration.mergeDuplicates() = copy(
parameters = parameters.map { it.mergeDuplicates() }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.jetbrains.dukat.tsmodel.ConstructorDeclaration
import org.jetbrains.dukat.tsmodel.FunctionDeclaration
import org.jetbrains.dukat.tsmodel.MemberDeclaration
import org.jetbrains.dukat.tsmodel.ParameterDeclaration
import org.jetbrains.dukat.tsmodel.PropertyDeclaration
import org.jetbrains.dukat.tsmodel.types.FunctionTypeDeclaration
import org.jetbrains.dukat.tsmodel.types.ObjectLiteralDeclaration
import org.jetbrains.dukat.tsmodel.types.ParameterValueDeclaration
Expand All @@ -31,6 +32,7 @@ internal fun MemberDeclaration.normalize(): MemberDeclaration {
is CallSignatureDeclaration -> this.normalize()
is ConstructorDeclaration -> this.normalize()
is FunctionDeclaration -> this.normalize()
is PropertyDeclaration -> this.normalize()
else -> this
}
}
Expand All @@ -47,6 +49,10 @@ internal fun FunctionDeclaration.normalize(substituteType: ParameterValueDeclara
uid = IRRELEVANT_UID
)

internal fun PropertyDeclaration.normalize() = copy(
type = type.normalize()
)

internal fun UnionTypeDeclaration.normalize() = copy(
params = params.map { it.normalize() }
)
Expand Down