diff --git a/ets2panda/compiler/core/compilerImpl.cpp b/ets2panda/compiler/core/compilerImpl.cpp index f62aaf1083f5cb9475524e7d843ab93790112a2d..0c66fb32c42b0dbaa7e81cb82a93afc9ad46e865 100644 --- a/ets2panda/compiler/core/compilerImpl.cpp +++ b/ets2panda/compiler/core/compilerImpl.cpp @@ -119,6 +119,7 @@ void HandleGenerateDecl(const parser::Program &program, util::DiagnosticEngine & } std::string result = program.Ast()->DumpDecl(); result.erase(0, result.find_first_not_of('\n')); + result = "'use static'\n" + result; outFile << result; outFile.close(); diff --git a/ets2panda/test/declgen/class-expected.txt b/ets2panda/test/declgen/class-expected.txt index 74dcb08e917a38ad5ee9709cd98b6dc34336fc84..443f6a2ee6957dfd8753ed0605de03499bb0e967 100644 --- a/ets2panda/test/declgen/class-expected.txt +++ b/ets2panda/test/declgen/class-expected.txt @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +'use static' export declare interface I0 { I0Method(a: string): String; diff --git a/ets2panda/test/declgen/enum-expected.txt b/ets2panda/test/declgen/enum-expected.txt index 0bff710d1fc55fa48285afee2e3f26bd08101f80..048eafcca47b44dbf2d8c0ed1e1ecd990c548e16 100644 --- a/ets2panda/test/declgen/enum-expected.txt +++ b/ets2panda/test/declgen/enum-expected.txt @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +'use static' export declare final class Direction extends BaseEnum { diff --git a/ets2panda/test/declgen/export-expected.txt b/ets2panda/test/declgen/export-expected.txt index 487a95e02fe2fc78e3903c4e59084d8684439aef..4a5c3b6e472845e90d74b974ec5e32d2b6785554 100644 --- a/ets2panda/test/declgen/export-expected.txt +++ b/ets2panda/test/declgen/export-expected.txt @@ -12,5 +12,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +'use static' export { union as union1 } from "./var"; \ No newline at end of file diff --git a/ets2panda/test/declgen/function-expected.txt b/ets2panda/test/declgen/function-expected.txt index 6212d507e84ca0e9ba6e83505d4a2935ce81c0f1..907c95b0501971d509c9adbc728ade562d69f6b2 100644 --- a/ets2panda/test/declgen/function-expected.txt +++ b/ets2panda/test/declgen/function-expected.txt @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + 'use static' export declare function add(x: number, y: number): double; export declare function greet(name: string, age?: number): String; diff --git a/ets2panda/test/declgen/import-expected.txt b/ets2panda/test/declgen/import-expected.txt index daaa85018d09067318156a99d38c956a2deba25a..9bcb9225654bf2c2f11292d375d4b3c2af718a1f 100644 --- a/ets2panda/test/declgen/import-expected.txt +++ b/ets2panda/test/declgen/import-expected.txt @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +'use static' import * as AllType from "./var"; import { union as union1 } from "./var"; \ No newline at end of file diff --git a/ets2panda/test/declgen/indirect_dependence-expected.txt b/ets2panda/test/declgen/indirect_dependence-expected.txt index 0889fa1c7cd1296ad074ade8daa94f6b181b96c6..9a4918b560868d29b3b39d19770a035518b52c39 100644 --- a/ets2panda/test/declgen/indirect_dependence-expected.txt +++ b/ets2panda/test/declgen/indirect_dependence-expected.txt @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +'use static' export declare function foo(c: C): int; export declare function foo1(): D; diff --git a/ets2panda/test/declgen/interface-expected.txt b/ets2panda/test/declgen/interface-expected.txt index 0e45342f0c8f82f14888d0a26a68fe3a1301ce03..f43e9fdb2890974b9be9c66cfd14fdbc983ac7f5 100644 --- a/ets2panda/test/declgen/interface-expected.txt +++ b/ets2panda/test/declgen/interface-expected.txt @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +'use static' export declare interface User { abstract set id(id: number): void; diff --git a/ets2panda/test/declgen/namespace-expected.txt b/ets2panda/test/declgen/namespace-expected.txt index 8089251f18d803230d4730ab93563acb857c7932..d90fc8793c7a9aa95f45bd23a82672deda7d78e6 100644 --- a/ets2panda/test/declgen/namespace-expected.txt +++ b/ets2panda/test/declgen/namespace-expected.txt @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +'use static' export declare namespace MathOperations { let PI: double; diff --git a/ets2panda/test/declgen/var-expected.txt b/ets2panda/test/declgen/var-expected.txt index 2a92bb7cf43e592c558a4fa4ef5ce53e70998e71..ca601392c06a86dbee14fe0f14c34802f34a1cb3 100644 --- a/ets2panda/test/declgen/var-expected.txt +++ b/ets2panda/test/declgen/var-expected.txt @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +'use static' export declare let n: double; export declare let o: Object;