This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip provided inner classes in processUnprovidedTypes()
- Loading branch information
Showing
5 changed files
with
130 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/test/java/com/google/javascript/clutz/double_inner_class_with_referenced_props.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
declare namespace ಠ_ಠ.clutz { | ||
class module$exports$ns$DoubleInnerClassWithRef { | ||
private noStructuralTyping_module$exports$ns$DoubleInnerClassWithRef : any; | ||
} | ||
} | ||
declare namespace ಠ_ಠ.clutz.module$exports$ns$DoubleInnerClassWithRef { | ||
interface Inner { | ||
baz (e1 : ಠ_ಠ.clutz.module$exports$ns$DoubleInnerClassWithRef.Inner.Enum1 , e2 : ಠ_ಠ.clutz.module$exports$ns$DoubleInnerClassWithRef.Inner.Enum2 ) : void ; | ||
} | ||
} | ||
declare namespace ಠ_ಠ.clutz.module$exports$ns$DoubleInnerClassWithRef.Inner { | ||
enum Enum1 { | ||
FOO = 'foo' , | ||
} | ||
enum Enum2 { | ||
BAR = 'bar' , | ||
} | ||
} | ||
declare module 'goog:ns.DoubleInnerClassWithRef' { | ||
import DoubleInnerClassWithRef = ಠ_ಠ.clutz.module$exports$ns$DoubleInnerClassWithRef; | ||
export default DoubleInnerClassWithRef; | ||
} |
30 changes: 30 additions & 0 deletions
30
src/test/java/com/google/javascript/clutz/double_inner_class_with_referenced_props.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
goog.module('ns.DoubleInnerClassWithRef'); | ||
|
||
class A {} | ||
|
||
/** | ||
* @interface | ||
*/ | ||
A.Inner = function() {}; | ||
|
||
/** | ||
* @enum {string} | ||
*/ | ||
A.Inner.Enum1 = { | ||
FOO: 'foo' | ||
}; | ||
|
||
/** | ||
* @enum {string} | ||
*/ | ||
A.Inner.Enum2 = { | ||
BAR: 'bar' | ||
}; | ||
|
||
/** | ||
* @param {A.Inner.Enum1} e1 | ||
* @param {A.Inner.Enum2} e2 | ||
*/ | ||
A.Inner.prototype.baz = function(e1, e2) {}; | ||
|
||
exports = A; |
22 changes: 22 additions & 0 deletions
22
src/test/java/com/google/javascript/clutz/inner_class_of_private_class.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
declare namespace ಠ_ಠ.clutz.ns.inner_class_of_private_class { | ||
class FooType_ { | ||
private noStructuralTyping_ns_inner_class_of_private_class_FooType_ : any; | ||
foo (inner : ಠ_ಠ.clutz.ns.inner_class_of_private_class.FooType_.Inner ) : void ; | ||
} | ||
} | ||
declare module 'goog:ns.inner_class_of_private_class' { | ||
import inner_class_of_private_class = ಠ_ಠ.clutz.ns.inner_class_of_private_class; | ||
export = inner_class_of_private_class; | ||
} | ||
declare namespace ಠ_ಠ.clutz.ns.inner_class_of_private_class { | ||
let FooInstance : ಠ_ಠ.clutz.ns.inner_class_of_private_class.FooType_ ; | ||
} | ||
declare module 'goog:ns.inner_class_of_private_class.FooInstance' { | ||
import FooInstance = ಠ_ಠ.clutz.ns.inner_class_of_private_class.FooInstance; | ||
export default FooInstance; | ||
} | ||
declare namespace ಠ_ಠ.clutz.ns.inner_class_of_private_class.FooType_ { | ||
class Inner { | ||
private noStructuralTyping_ns_inner_class_of_private_class_FooType__Inner : any; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/test/java/com/google/javascript/clutz/inner_class_of_private_class.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
goog.provide('ns.inner_class_of_private_class'); | ||
goog.provide('ns.inner_class_of_private_class.FooInstance'); | ||
|
||
//!! This is a generalized code of `goog.debug.Trace`. | ||
//!! https://github.com/google/closure-library/blob/master/closure/goog/debug/tracer.js | ||
|
||
/** | ||
* @constructor | ||
* @private | ||
*/ | ||
ns.inner_class_of_private_class.FooType_ = function() {}; | ||
|
||
/** | ||
* @param {!ns.inner_class_of_private_class.FooType_.Inner} inner | ||
*/ | ||
ns.inner_class_of_private_class.FooType_.prototype.foo = function(inner) {}; | ||
|
||
/** | ||
* @constructor | ||
*/ | ||
ns.inner_class_of_private_class.FooType_.Inner = function() {}; | ||
|
||
/** | ||
* @type {!ns.inner_class_of_private_class.FooType_} | ||
*/ | ||
ns.inner_class_of_private_class.FooInstance = new ns.inner_class_of_private_class.FooType_(); |