Statically extensible types allow a static type system to model the behavior of dynamic object model extension in dynamic runtime systems. Static types that model dynamically extended types can be extended using additional declarations in the same compilation. Declarations for a particular type can come from multiple independent sources which can have been defined at multiple points in time. Extension declarations can use the same syntax as the initial type declaration. Hence presence of one or more declarations for the same type in a compilation can indicate that the type has been extended. These features allow static type checking of dynamic plug-ins to be supported using statically extensible types. Declarations and extension declarations for a type can be merged together to create an extended type that enables different processing paths and dependencies.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A method comprising: receiving by a processor of a software development computer, program source code comprising an initial declaration for a static type of a component in a first file; receiving program source code comprising at least one additional declaration comprising a static type extension for the static type of the component in a second file, where the at least one additional declaration extends capabilities of the component at runtime; merging the initial declaration for the static type of the component in the first file with the at least one additional declaration for the static type of the component in the second file to create a merged static type declaration; using the merged static type declaration for static type checking during compilation.
2. The method of claim 1 , wherein the first file is created by a first source and the second file is created by a second source independent of the first source.
3. The method of claim 1 , wherein the static type comprises a static interface type.
4. The method of claim 1 , wherein the program source code is written in TypeScript.
5. The method of claim 1 , wherein the initial declaration and the at least one additional declaration use a common syntax.
6. The method of claim 1 , wherein the initial declaration uses a first syntax and the at least one additional declaration use a second syntax distinct from the first syntax.
7. A system comprising: at least one processor: and a memory connected to the at least one processor; and the at least one processor configured to: receive program source code comprising an initial declaration for a static type of a component in a first file from a first source; receive program source code comprising at least one additional declaration for the static type of the component in a second file from a second source, wherein the at least one additional declaration extends capabilities of the component at runtime; and in response to receiving a reference to the static type of the component, display information associated with a merged representation of the static type of the component, the merged representation of the static type of the component including the initial declaration and the at least one additional declaration.
8. The system of claim 7 , wherein the at least one processor is configured to: receive program source code comprising TypeScript program source code.
9. The system of claim 7 , wherein the at least one processor is configured to: merge the initial declaration and the at least one additional declaration for the static type of the component to create a merged declaration for the static type.
10. The system of claim 7 , wherein the static type comprises a static interface type.
11. The system of claim 9 , wherein the at least one processor is further configured to: perform static type checking on the program source code based on the merged declaration for the static type.
12. The system of claim 7 , wherein the initial declaration and the at least one additional declaration use a common syntax.
13. The system of claim 7 , wherein the initial declaration uses a first syntax and the at least one additional declaration use a second syntax distinct from the first syntax.
14. A device, comprising: at least one processor and a memory; the at least one processor configured to: perform static type checking at compilation time on program source code based on an extended static interface type, the extended static interface type comprising an initial static type defined by an initial declaration provided in a first source code file merged with at least one extension declaration provided in at least one additional source code file for the initial static type, wherein the at least one extension declaration extends capabilities of a component of the program source code at runtime.
15. The device of claim 14 , wherein the at least one processor is further configured to: receive the first source code file, the first source code file originating from a first source and receive the second source code file, the second source code file originating from a second source that is not the first source.
16. The device of claim 14 , wherein the at least one processor is further configured to: receive the first source code file, the first source code file defining the initial static type using a first syntax and receiving the second source code file, the second source code file defining an extension to the static type using the first syntax.
17. The device of claim 14 , wherein the at least one processor is further configured to: receive the first source code file, the first source code file defining the initial static type using a first syntax and receiving the second source code file, the second source code file defining an extension to the static type using a second syntax distinct from the first syntax.
18. The device of claim 14 , wherein the at least one processor is further configured to: receive a plurality of program source code files, wherein a first file of the plurality of source code files defines a first capability of a static interface and wherein a second file of the plurality of source code files defines a second capability of the static interface.
19. The device of claim 14 , wherein the at least one processor is further configured to: receive program source code written in TypeScript.
20. The device of claim 14 , wherein the at least one processor is further configured to: model a dynamic plug-in system extensibility capability in a static type system.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
March 13, 2013
February 7, 2017
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.