Skip to content

Commit

Permalink
Replace dot notation with quotes notation when referencing exported p…
Browse files Browse the repository at this point in the history
…roperties in j2wasm jssuite template.

PiperOrigin-RevId: 560737513
  • Loading branch information
mollyibot authored and copybara-github committed Aug 28, 2023
1 parent 1e1ea94 commit 3825b39
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions junit/generator/java/com/google/j2cl/junit/apt/WasmJsSuite.vm
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ testSuite({
const absolutePath = "REPLACEMENT_BUILD_PATH_PLACEHOLDER";

instance = await j2wasm.instantiateStreaming(absolutePath);
instance.exports.setUpPageIn${testClass.simpleName()}();
instance.exports["setUpPageIn${testClass.simpleName()}"]();
},

tearDownPage() {
// Note that exports might be null due to a failed instantiation.
instance?.exports?.tearDownPageIn${testClass.simpleName()}();
instance?.exports["tearDownPageIn${testClass.simpleName()}"]();
},

setUp() {
instance.exports.setUpIn${testClass.simpleName()}();
instance.exports["setUpIn${testClass.simpleName()}"]();
},

tearDown() {
instance.exports.tearDownIn${testClass.simpleName()}();
instance.exports["tearDownIn${testClass.simpleName()}"]();
},

#foreach($testMethod in ${testClass.testMethods()})
${testMethod.jsTestMethodName()}() {
instance.exports.${testMethod.jsTestMethodName()}In${testClass.simpleName()}();
instance.exports["${testMethod.jsTestMethodName()}In${testClass.simpleName()}"]();
},

#end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ And second line!
at m_test__void@com.google.j2cl.junit.integration.stacktrace.data.SimpleThrowingStacktraceTest(SimpleThrowingStacktraceTest.java:27)
at m_testInSimpleThrowingStacktraceTest__void@javatests.com.google.j2cl.junit.integration.stacktrace.data.SimpleThrowingStacktraceTest_Adapter(SimpleThrowingStacktraceTest_Adapter.java:43)
at m_testInSimpleThrowingStacktraceTest__$export__void@javatests.com.google.j2cl.junit.integration.stacktrace.data.SimpleThrowingStacktraceTest_Adapter(SimpleThrowingStacktraceTest_Adapter.java:41)
at Object.test(junit/generator/javatests/com/google/j2cl/junit/integration/stacktrace/data/SimpleThrowingStacktraceTest-j2wasm_generated_suite.js.zip!/com/google/j2cl/junit/integration/stacktrace/data/SimpleThrowingStacktraceTest.js:37:22)
at Object.test(junit/generator/javatests/com/google/j2cl/junit/integration/stacktrace/data/SimpleThrowingStacktraceTest-j2wasm_generated_suite.js.zip!/com/google/j2cl/junit/integration/stacktrace/data/SimpleThrowingStacktraceTest.js:37:59)
__OPTIONAL__ # Testing infra on J2CL
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ java.lang.RuntimeException: __the_message__!
at create(jre/java/super-wasm/exception_utils.js:26:13)
at m_createJsError__java_lang_Throwable__javaemul_internal_Exceptions_JsErrorWrapper@javaemul.internal.Exceptions(String.java:747)
at m_testInSimpleThrowingStacktraceTest__$export__void@javatests.com.google.j2cl.junit.integration.stacktrace.data.SimpleThrowingStacktraceTest_Adapter(Throwable.java:101)
at Object.test(junit/generator/javatests/com/google/j2cl/junit/integration/stacktrace/data/SimpleThrowingStacktraceTest-j2wasm_optimized_generated_suite.js.zip!/com/google/j2cl/junit/integration/stacktrace/data/SimpleThrowingStacktraceTest.js:37:22)
at Object.test(junit/generator/javatests/com/google/j2cl/junit/integration/stacktrace/data/SimpleThrowingStacktraceTest-j2wasm_optimized_generated_suite.js.zip!/com/google/j2cl/junit/integration/stacktrace/data/SimpleThrowingStacktraceTest.js:37:59)
__OPTIONAL__ # Testing infra on J2CL

0 comments on commit 3825b39

Please sign in to comment.