[K/JS] Add ES6 typescript tests + fix a few bugs for it
This commit is contained in:
-2
@@ -1,7 +1,5 @@
|
||||
/** This file is generated by {@link :js:js.test:generateTypeScriptJsExportOnFileTests} task. DO NOT MODIFY MANUALLY */
|
||||
|
||||
// TARGET_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// CHECK_TYPESCRIPT_DECLARATIONS
|
||||
// RUN_PLAIN_BOX_FUNCTION
|
||||
// SKIP_MINIFICATION
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// TARGET_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// CHECK_TYPESCRIPT_DECLARATIONS
|
||||
// RUN_PLAIN_BOX_FUNCTION
|
||||
// SKIP_MINIFICATION
|
||||
|
||||
+3
-12
@@ -2,23 +2,14 @@ import SomeBaseClass = JS_TESTS.foo.SomeBaseClass;
|
||||
import SomeExtendingClass = JS_TESTS.foo.SomeExtendingClass;
|
||||
import FinalClassInChain = JS_TESTS.foo.FinalClassInChain;
|
||||
|
||||
function assert(condition: boolean) {
|
||||
if (!condition) {
|
||||
throw "Assertion failed";
|
||||
}
|
||||
}
|
||||
|
||||
function box(): string {
|
||||
// @ts-expect-error "the constructor is private and can't be used from JS/TS code"
|
||||
const baseClass = new SomeBaseClass(4)
|
||||
assert(baseClass.answer === 4)
|
||||
new SomeBaseClass(4)
|
||||
|
||||
// @ts-expect-error "the constructor is private and can't be used from JS/TS code"
|
||||
const extendingClass = new SomeExtendingClass()
|
||||
assert(extendingClass.answer === 42)
|
||||
new SomeExtendingClass()
|
||||
|
||||
const finalClassInChain = new FinalClassInChain()
|
||||
assert(finalClassInChain.answer === 42)
|
||||
new FinalClassInChain()
|
||||
|
||||
return "OK";
|
||||
}
|
||||
Reference in New Issue
Block a user