[K/JS] Compile Kotlin coroutines as JS generator ^KT-63038 Fixed
This commit is contained in:
@@ -80,6 +80,11 @@ class JsPrecedenceVisitor extends JsVisitor {
|
||||
answer = 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitYield(@NotNull JsYield yield) {
|
||||
answer = 2; // https://esdiscuss.org/topic/precedence-of-yield-operator
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitNameRef(@NotNull JsNameRef nameRef) {
|
||||
if (nameRef.isLeaf()) {
|
||||
|
||||
@@ -27,6 +27,7 @@ public class JsToStringGenerationVisitor extends JsVisitor {
|
||||
private static final char[] CHARS_CLASS = "class".toCharArray();
|
||||
private static final char[] CHARS_CONSTRUCTOR = "constructor".toCharArray();
|
||||
private static final char[] CHARS_CONTINUE = "continue".toCharArray();
|
||||
private static final char[] CHARS_YIELD = "yield".toCharArray();
|
||||
private static final char[] CHARS_DEBUGGER = "debugger".toCharArray();
|
||||
private static final char[] CHARS_DEFAULT = "default".toCharArray();
|
||||
private static final char[] CHARS_DO = "do".toCharArray();
|
||||
@@ -46,6 +47,7 @@ public class JsToStringGenerationVisitor extends JsVisitor {
|
||||
private static final char[] CHARS_RETURN = "return".toCharArray();
|
||||
private static final char[] CHARS_SWITCH = "switch".toCharArray();
|
||||
private static final char[] CHARS_THIS = "this".toCharArray();
|
||||
private static final char CHARS_GENERATOR = '*';
|
||||
|
||||
private static final char[] CHARS_SUPER = "super".toCharArray();
|
||||
private static final char[] CHARS_THROW = "throw".toCharArray();
|
||||
@@ -337,6 +339,24 @@ public class JsToStringGenerationVisitor extends JsVisitor {
|
||||
popSourceInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitYield(@NotNull JsYield x) {
|
||||
pushSourceInfo(x.getSource());
|
||||
printCommentsBeforeNode(x);
|
||||
|
||||
p.print(CHARS_YIELD);
|
||||
|
||||
JsExpression expression = x.getExpression();
|
||||
|
||||
if (expression != null) {
|
||||
space();
|
||||
accept(x.getExpression());
|
||||
}
|
||||
|
||||
printCommentsAfterNode(x);
|
||||
popSourceInfo();
|
||||
}
|
||||
|
||||
private void continueOrBreakLabel(JsContinue x) {
|
||||
JsNameRef label = x.getLabel();
|
||||
if (label != null) {
|
||||
@@ -684,6 +704,10 @@ public class JsToStringGenerationVisitor extends JsVisitor {
|
||||
space();
|
||||
}
|
||||
|
||||
if (x.isGenerator()) {
|
||||
p.print(CHARS_GENERATOR);
|
||||
}
|
||||
|
||||
if (x.getName() != null) {
|
||||
nameOf(x);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.*;
|
||||
|
||||
public final class JsFunction extends JsLiteral implements HasName {
|
||||
public enum Modifier { STATIC, GET, SET }
|
||||
public enum Modifier { STATIC, GET, SET, GENERATOR }
|
||||
|
||||
@NotNull
|
||||
private JsBlock body;
|
||||
@@ -81,6 +81,10 @@ public final class JsFunction extends JsLiteral implements HasName {
|
||||
return modifiers != null && modifiers.contains(Modifier.SET);
|
||||
}
|
||||
|
||||
public boolean isGenerator() {
|
||||
return modifiers != null && modifiers.contains(Modifier.GENERATOR);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<Modifier> getModifiers() {
|
||||
if (modifiers == null) {
|
||||
|
||||
@@ -22,6 +22,10 @@ public final class JsNew extends JsExpression.JsExpressionHasArguments {
|
||||
this.constructorExpression = constructorExpression;
|
||||
}
|
||||
|
||||
public JsNew(JsExpression constructorExpression, JsExpression... arguments) {
|
||||
this(constructorExpression, new SmartList<JsExpression>(arguments));
|
||||
}
|
||||
|
||||
public JsExpression getConstructorExpression() {
|
||||
return constructorExpression;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,9 @@ abstract class JsVisitor {
|
||||
open fun visitContinue(x: JsContinue): Unit =
|
||||
visitElement(x)
|
||||
|
||||
open fun visitYield(x: JsYield): Unit =
|
||||
visitElement(x)
|
||||
|
||||
open fun visitDebugger(x: JsDebugger): Unit =
|
||||
visitElement(x)
|
||||
|
||||
|
||||
@@ -101,6 +101,9 @@ public abstract class JsVisitorWithContext {
|
||||
public void endVisit(@NotNull JsContinue x, @NotNull JsContext ctx) {
|
||||
}
|
||||
|
||||
public void endVisit(@NotNull JsYield x, @NotNull JsContext ctx) {
|
||||
}
|
||||
|
||||
public void endVisit(@NotNull JsDebugger x, @NotNull JsContext ctx) {
|
||||
}
|
||||
|
||||
@@ -274,6 +277,10 @@ public abstract class JsVisitorWithContext {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean visit(@NotNull JsYield x, @NotNull JsContext ctx) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean visit(@NotNull JsDebugger x, @NotNull JsContext ctx) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.js.backend.ast
|
||||
|
||||
import org.jetbrains.kotlin.js.util.AstUtil
|
||||
|
||||
class JsYield(var expression: JsExpression?) : JsExpression() {
|
||||
override fun accept(visitor: JsVisitor) {
|
||||
visitor.visitYield(this)
|
||||
}
|
||||
|
||||
override fun acceptChildren(visitor: JsVisitor) {
|
||||
visitor.accept(expression)
|
||||
}
|
||||
|
||||
override fun deepCopy(): JsExpression {
|
||||
return JsYield(AstUtil.deepCopy(expression)).withMetadataFrom(this)
|
||||
}
|
||||
|
||||
override fun traverse(visitor: JsVisitorWithContext, ctx: JsContext<*>) {
|
||||
if (visitor.visit(this, ctx)) {
|
||||
expression = visitor.accept(expression)
|
||||
}
|
||||
visitor.endVisit(this, ctx)
|
||||
}
|
||||
}
|
||||
@@ -82,6 +82,8 @@ var HasMetadata.synthetic: Boolean by MetadataProperty(default = false)
|
||||
var HasMetadata.isInlineClassBoxing: Boolean by MetadataProperty(default = false)
|
||||
var HasMetadata.isInlineClassUnboxing: Boolean by MetadataProperty(default = false)
|
||||
|
||||
var HasMetadata.isGeneratorFunction: Boolean by MetadataProperty(default = false)
|
||||
|
||||
var HasMetadata.sideEffects: SideEffectKind by MetadataProperty(default = SideEffectKind.AFFECTS_STATE)
|
||||
|
||||
/**
|
||||
|
||||
@@ -87,6 +87,9 @@ public class JSConfigurationKeys {
|
||||
public static final CompilerConfigurationKey<Boolean> GENERATE_DTS =
|
||||
CompilerConfigurationKey.create("generate TypeScript definition file");
|
||||
|
||||
public static final CompilerConfigurationKey<Boolean> COMPILE_SUSPEND_AS_JS_GENERATOR =
|
||||
CompilerConfigurationKey.create("force suspend functions compilation int JS generator functions");
|
||||
|
||||
public static final CompilerConfigurationKey<Boolean> GENERATE_REGION_COMMENTS =
|
||||
CompilerConfigurationKey.create("generate special comments at the start and the end of each file block, " +
|
||||
"it allows to fold them and navigate to them in the IDEA");
|
||||
|
||||
@@ -178,6 +178,7 @@ public class JsAstMapper {
|
||||
return mapSetElem(node);
|
||||
|
||||
case TokenStream.FUNCTION:
|
||||
case TokenStream.GENERATOR:
|
||||
return mapFunction(node);
|
||||
|
||||
case TokenStream.BLOCK:
|
||||
@@ -199,6 +200,9 @@ public class JsAstMapper {
|
||||
case TokenStream.CONTINUE:
|
||||
return mapContinue(node);
|
||||
|
||||
case TokenStream.YIELD:
|
||||
return mapYield(node);
|
||||
|
||||
case TokenStream.OBJLIT:
|
||||
return mapObjectLit(node);
|
||||
|
||||
@@ -387,6 +391,10 @@ public class JsAstMapper {
|
||||
return new JsContinue(getTargetLabel(contNode));
|
||||
}
|
||||
|
||||
private JsYield mapYield(Node yieldNode) {
|
||||
return new JsYield(mapExpression(yieldNode.getFirstChild()));
|
||||
}
|
||||
|
||||
private JsStatement mapDebuggerStatement(Node node) {
|
||||
// Calls an optional method to invoke the debugger.
|
||||
//
|
||||
@@ -570,7 +578,7 @@ public class JsAstMapper {
|
||||
|
||||
public JsFunction mapFunction(Node fnNode) throws JsParserException {
|
||||
int nodeType = fnNode.getType();
|
||||
assert nodeType == TokenStream.FUNCTION: "Expected function node, got: " + TokenStream.tokenToName(nodeType);
|
||||
assert nodeType == TokenStream.FUNCTION || nodeType == TokenStream.GENERATOR: "Expected function node, got: " + TokenStream.tokenToName(nodeType);
|
||||
Node fromFnNameNode = fnNode.getFirstChild();
|
||||
Node fromParamNode = fnNode.getFirstChild().getNext().getFirstChild();
|
||||
Node fromBodyNode = fnNode.getFirstChild().getNext().getNext();
|
||||
@@ -586,6 +594,10 @@ public class JsAstMapper {
|
||||
JsFunction toFn = scopeContext.enterFunction();
|
||||
toFn.setName(functionName);
|
||||
|
||||
if (nodeType == TokenStream.GENERATOR) {
|
||||
toFn.getModifiers().add(JsFunction.Modifier.GENERATOR);
|
||||
}
|
||||
|
||||
while (fromParamNode != null) {
|
||||
String fromParamName = fromParamNode.getString();
|
||||
JsName name = scopeContext.localNameFor(fromParamName);
|
||||
|
||||
@@ -180,6 +180,19 @@ public class IRFactory {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Yield (possibly with expression)
|
||||
*/
|
||||
public Node createYield(Node expression, CodePosition location) {
|
||||
Node result = new Node(TokenStream.YIELD, location);
|
||||
if (expression == null) {
|
||||
return result;
|
||||
} else {
|
||||
result.addChildToBack(expression);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* debugger
|
||||
*/
|
||||
@@ -197,11 +210,11 @@ public class IRFactory {
|
||||
return new Node(TokenStream.BLOCK, location);
|
||||
}
|
||||
|
||||
public Node createFunction(Node name, Node args, Node statements, CodePosition location) {
|
||||
public Node createFunction(Node name, Node args, Node statements, boolean isGenerator, CodePosition location) {
|
||||
if (name == null) {
|
||||
name = createName("", location);
|
||||
}
|
||||
return new Node(TokenStream.FUNCTION, name, args, statements, location);
|
||||
return new Node(isGenerator ? TokenStream.GENERATOR : TokenStream.FUNCTION, name, args, statements, location);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -186,6 +186,10 @@ public class Parser {
|
||||
|
||||
Node nameNode;
|
||||
Node memberExprNode = null;
|
||||
|
||||
// For generators
|
||||
boolean isGenerator = ts.matchToken(TokenStream.MUL);
|
||||
|
||||
if (ts.matchToken(TokenStream.NAME)) {
|
||||
nameNode = nf.createName(ts.getString(), basePosition);
|
||||
if (!ts.matchToken(TokenStream.LP)) {
|
||||
@@ -248,7 +252,7 @@ public class Parser {
|
||||
functionNumber = savedFunctionNumber;
|
||||
}
|
||||
|
||||
Node pn = nf.createFunction(nameNode, args, body, basePosition);
|
||||
Node pn = nf.createFunction(nameNode, args, body, isGenerator, basePosition);
|
||||
if (memberExprNode != null) {
|
||||
pn = nf.createBinary(TokenStream.ASSIGN, TokenStream.NOP, memberExprNode, pn, basePosition);
|
||||
}
|
||||
@@ -897,6 +901,9 @@ public class Parser {
|
||||
CodePosition position = ts.tokenPosition;
|
||||
|
||||
switch (tt) {
|
||||
case TokenStream.YIELD:
|
||||
return nf.createUnary(TokenStream.YIELD, ts.getOp(), unaryExpr(ts), position);
|
||||
|
||||
case TokenStream.UNARYOP:
|
||||
return nf.createUnary(TokenStream.UNARYOP, ts.getOp(), unaryExpr(ts), position);
|
||||
|
||||
|
||||
@@ -254,6 +254,9 @@ public class TokenStream {
|
||||
LAST_TOKEN = 147,
|
||||
NUMBER_INT = 148,
|
||||
|
||||
GENERATOR = 149,
|
||||
YIELD = 150,
|
||||
|
||||
// This value is only used as a return value for getTokenHelper,
|
||||
// which is only called from getToken and exists to avoid an excessive
|
||||
// recursion problem if a number of lines in a row are comments.
|
||||
@@ -390,6 +393,7 @@ public class TokenStream {
|
||||
case FOR: return "for";
|
||||
case BREAK: return "break";
|
||||
case CONTINUE: return "continue";
|
||||
case YIELD: return "yield";
|
||||
case VAR: return "var";
|
||||
case WITH: return "with";
|
||||
case CATCH: return "catch";
|
||||
@@ -456,6 +460,7 @@ public class TokenStream {
|
||||
KEYWORDS.put("break", BREAK);
|
||||
KEYWORDS.put("case", CASE);
|
||||
KEYWORDS.put("continue", CONTINUE);
|
||||
KEYWORDS.put("yield", YIELD);
|
||||
KEYWORDS.put("default", DEFAULT);
|
||||
KEYWORDS.put("delete", DELPROP);
|
||||
KEYWORDS.put("do", DO);
|
||||
|
||||
@@ -122,6 +122,7 @@ message Function {
|
||||
STATIC = 1;
|
||||
GET = 2;
|
||||
SET = 3;
|
||||
GENERATOR = 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -426,6 +426,7 @@ abstract class JsAstDeserializerBase {
|
||||
JsAstProtoBuf.Function.Modifier.STATIC -> JsFunction.Modifier.STATIC
|
||||
JsAstProtoBuf.Function.Modifier.SET -> JsFunction.Modifier.SET
|
||||
JsAstProtoBuf.Function.Modifier.GET -> JsFunction.Modifier.GET
|
||||
JsAstProtoBuf.Function.Modifier.GENERATOR -> JsFunction.Modifier.GENERATOR
|
||||
}
|
||||
|
||||
protected fun map(op: JsAstProtoBuf.BinaryOperation.Type) = when (op) {
|
||||
|
||||
@@ -8934,6 +8934,10 @@ public final class JsAstProtoBuf {
|
||||
* <code>SET = 3;</code>
|
||||
*/
|
||||
SET(2, 3),
|
||||
/**
|
||||
* <code>GENERATOR = 4;</code>
|
||||
*/
|
||||
GENERATOR(3, 4),
|
||||
;
|
||||
|
||||
/**
|
||||
@@ -8948,6 +8952,10 @@ public final class JsAstProtoBuf {
|
||||
* <code>SET = 3;</code>
|
||||
*/
|
||||
public static final int SET_VALUE = 3;
|
||||
/**
|
||||
* <code>GENERATOR = 4;</code>
|
||||
*/
|
||||
public static final int GENERATOR_VALUE = 4;
|
||||
|
||||
|
||||
public final int getNumber() { return value; }
|
||||
@@ -8957,6 +8965,7 @@ public final class JsAstProtoBuf {
|
||||
case 1: return STATIC;
|
||||
case 2: return GET;
|
||||
case 3: return SET;
|
||||
case 4: return GENERATOR;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,6 +442,7 @@ abstract class JsAstSerializerBase {
|
||||
JsFunction.Modifier.STATIC -> JsAstProtoBuf.Function.Modifier.STATIC
|
||||
JsFunction.Modifier.SET -> JsAstProtoBuf.Function.Modifier.SET
|
||||
JsFunction.Modifier.GET -> JsAstProtoBuf.Function.Modifier.GET
|
||||
JsFunction.Modifier.GENERATOR -> JsAstProtoBuf.Function.Modifier.GENERATOR
|
||||
}
|
||||
|
||||
protected fun map(op: JsBinaryOperator) = when (op) {
|
||||
|
||||
@@ -93,6 +93,14 @@ fun main(args: Array<String>) {
|
||||
model("incremental/invalidation/", pattern = "^([^_](.+))$", targetBackend = TargetBackend.JS_IR, recursive = false)
|
||||
}
|
||||
|
||||
testClass<AbstractJsFirES6InvalidationPerFileTest> {
|
||||
model("incremental/invalidation/", pattern = "^([^_](.+))$", targetBackend = TargetBackend.JS_IR_ES6, recursive = false)
|
||||
}
|
||||
|
||||
testClass<AbstractJsFirES6InvalidationPerModuleTest> {
|
||||
model("incremental/invalidation/", pattern = "^([^_](.+))$", targetBackend = TargetBackend.JS_IR_ES6, recursive = false)
|
||||
}
|
||||
|
||||
testClass<AbstractJsIrInvalidationPerFileWithPLTest> {
|
||||
model("incremental/invalidationWithPL/", pattern = "^([^_](.+))$", targetBackend = TargetBackend.JS_IR, recursive = false)
|
||||
}
|
||||
|
||||
@@ -139,6 +139,7 @@ abstract class AbstractInvalidationTest(
|
||||
copy.put(JSConfigurationKeys.PROPERTY_LAZY_INITIALIZATION, true)
|
||||
copy.put(JSConfigurationKeys.SOURCE_MAP, true)
|
||||
copy.put(JSConfigurationKeys.USE_ES6_CLASSES, targetBackend == TargetBackend.JS_IR_ES6)
|
||||
copy.put(JSConfigurationKeys.COMPILE_SUSPEND_AS_JS_GENERATOR, targetBackend == TargetBackend.JS_IR_ES6)
|
||||
|
||||
copy.languageVersionSettings = with(LanguageVersionSettingsBuilder()) {
|
||||
language.forEach {
|
||||
|
||||
@@ -26,6 +26,10 @@ abstract class AbstractJsFirInvalidationPerFileTest :
|
||||
FirAbstractInvalidationTest(TargetBackend.JS_IR, JsGenerationGranularity.PER_FILE, "incrementalOut/invalidationFir/perFile")
|
||||
abstract class AbstractJsFirInvalidationPerModuleTest :
|
||||
FirAbstractInvalidationTest(TargetBackend.JS_IR, JsGenerationGranularity.PER_MODULE, "incrementalOut/invalidationFir/perModule")
|
||||
abstract class AbstractJsFirES6InvalidationPerFileTest :
|
||||
FirAbstractInvalidationTest(TargetBackend.JS_IR_ES6, JsGenerationGranularity.PER_FILE, "incrementalOut/invalidationFirES6/perFile")
|
||||
abstract class AbstractJsFirES6InvalidationPerModuleTest :
|
||||
FirAbstractInvalidationTest(TargetBackend.JS_IR_ES6, JsGenerationGranularity.PER_MODULE, "incrementalOut/invalidationFirES6/perModule")
|
||||
|
||||
abstract class FirAbstractInvalidationTest(
|
||||
targetBackend: TargetBackend,
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/incremental/JsFirES6InvalidationPerFileTestGenerated.java
Generated
+597
@@ -0,0 +1,597 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.incremental;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateJsTestsKt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("js/js.translator/testData/incremental/invalidation")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class JsFirES6InvalidationPerFileTestGenerated extends AbstractJsFirES6InvalidationPerFileTest {
|
||||
@Test
|
||||
@TestMetadata("abstractClassWithJsExport")
|
||||
public void testAbstractClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/abstractClassWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("addUpdateRemoveDependentFile")
|
||||
public void testAddUpdateRemoveDependentFile() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/addUpdateRemoveDependentFile/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("addUpdateRemoveDependentModule")
|
||||
public void testAddUpdateRemoveDependentModule() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/addUpdateRemoveDependentModule/");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllFilesPresentInInvalidation() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/incremental/invalidation"), Pattern.compile("^([^_](.+))$"), null, TargetBackend.JS_IR_ES6, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("circleExportsUpdate")
|
||||
public void testCircleExportsUpdate() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/circleExportsUpdate/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("circleInlineImportsUpdate")
|
||||
public void testCircleInlineImportsUpdate() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/circleInlineImportsUpdate/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("class")
|
||||
public void testClass() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/class/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classFunctionsAndFields")
|
||||
public void testClassFunctionsAndFields() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classFunctionsAndFields/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classWithJsExport")
|
||||
public void testClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionConstVal")
|
||||
public void testCompanionConstVal() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/companionConstVal/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionFunction")
|
||||
public void testCompanionFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/companionFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionInlineFunction")
|
||||
public void testCompanionInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/companionInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionProperties")
|
||||
public void testCompanionProperties() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/companionProperties/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionWithStdLibCall")
|
||||
public void testCompanionWithStdLibCall() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/companionWithStdLibCall/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("constVals")
|
||||
public void testConstVals() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/constVals/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("crossModuleReferences")
|
||||
public void testCrossModuleReferences() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/crossModuleReferences/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("eagerInitialization")
|
||||
public void testEagerInitialization() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/eagerInitialization/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enum")
|
||||
public void testEnum() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/enum/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumsInInlineFunctions")
|
||||
public void testEnumsInInlineFunctions() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/enumsInInlineFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exceptionsFromInlineFunction")
|
||||
public void testExceptionsFromInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/exceptionsFromInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportsThroughInlineFunction")
|
||||
public void testExportsThroughInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/exportsThroughInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideClassFunctionQualifiers")
|
||||
public void testFakeOverrideClassFunctionQualifiers() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fakeOverrideClassFunctionQualifiers/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideInheritance")
|
||||
public void testFakeOverrideInheritance() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fakeOverrideInheritance/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideInlineExtension")
|
||||
public void testFakeOverrideInlineExtension() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fakeOverrideInlineExtension/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideInlineFunction")
|
||||
public void testFakeOverrideInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fakeOverrideInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideInlineProperty")
|
||||
public void testFakeOverrideInlineProperty() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fakeOverrideInlineProperty/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideInterfaceFunctionQualifiers")
|
||||
public void testFakeOverrideInterfaceFunctionQualifiers() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fakeOverrideInterfaceFunctionQualifiers/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fastPath1")
|
||||
public void testFastPath1() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fastPath1/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fastPath2")
|
||||
public void testFastPath2() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fastPath2/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fileNameClash")
|
||||
public void testFileNameClash() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fileNameClash/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("friendDependency")
|
||||
public void testFriendDependency() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/friendDependency/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionDefaultParams")
|
||||
public void testFunctionDefaultParams() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/functionDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionSignature")
|
||||
public void testFunctionSignature() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/functionSignature/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionTypeInterface")
|
||||
public void testFunctionTypeInterface() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/functionTypeInterface/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionTypeInterfaceReflect")
|
||||
public void testFunctionTypeInterfaceReflect() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/functionTypeInterfaceReflect/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericFunctions")
|
||||
public void testGenericFunctions() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/genericFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericInlineFunctions")
|
||||
public void testGenericInlineFunctions() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/genericInlineFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("gettersAndSettersInlining")
|
||||
public void testGettersAndSettersInlining() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/gettersAndSettersInlining/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineBecomeNonInline")
|
||||
public void testInlineBecomeNonInline() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineBecomeNonInline/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunctionAnnotations")
|
||||
public void testInlineFunctionAnnotations() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionAnnotations/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunctionAsFunctionReference")
|
||||
public void testInlineFunctionAsFunctionReference() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionAsFunctionReference/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunctionAsParam")
|
||||
public void testInlineFunctionAsParam() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionAsParam/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunctionCircleUsage")
|
||||
public void testInlineFunctionCircleUsage() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionCircleUsage/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunctionDefaultParams")
|
||||
public void testInlineFunctionDefaultParams() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunctionWithObject")
|
||||
public void testInlineFunctionWithObject() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionWithObject/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceOpenMethods")
|
||||
public void testInterfaceOpenMethods() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceOpenMethods/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceOpenMethodsInOpenClass")
|
||||
public void testInterfaceOpenMethodsInOpenClass() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceOpenMethodsInOpenClass/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceSuperUsage")
|
||||
public void testInterfaceSuperUsage() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceWithDefaultParams")
|
||||
public void testInterfaceWithDefaultParams() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceWithJsExport")
|
||||
public void testInterfaceWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsCode")
|
||||
public void testJsCode() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsCode/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsCodeWithConstString")
|
||||
public void testJsCodeWithConstString() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsCodeWithConstString/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsCodeWithConstStringFromOtherModule")
|
||||
public void testJsCodeWithConstStringFromOtherModule() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsCodeWithConstStringFromOtherModule/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsExport")
|
||||
public void testJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsExportReexport")
|
||||
public void testJsExportReexport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsExportReexport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsExportWithMultipleFiles")
|
||||
public void testJsExportWithMultipleFiles() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsExportWithMultipleFiles/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsModuleAnnotation")
|
||||
public void testJsModuleAnnotation() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsModuleAnnotation/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsModuleAnnotationOnObjectWithUsage")
|
||||
public void testJsModuleAnnotationOnObjectWithUsage() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsModuleAnnotationOnObjectWithUsage/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsName")
|
||||
public void testJsName() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsName/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinTest")
|
||||
public void testKotlinTest() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/kotlinTest/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("languageVersionSettings")
|
||||
public void testLanguageVersionSettings() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/languageVersionSettings/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("localInlineFunction")
|
||||
public void testLocalInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/localInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("localObjectsLeakThroughInterface")
|
||||
public void testLocalObjectsLeakThroughInterface() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/localObjectsLeakThroughInterface/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mainFunction")
|
||||
public void testMainFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/mainFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mainModuleInvalidation")
|
||||
public void testMainModuleInvalidation() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/mainModuleInvalidation/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("moveAndModifyInlineFunction")
|
||||
public void testMoveAndModifyInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/moveAndModifyInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("moveExternalDeclarationsBetweenFiles")
|
||||
public void testMoveExternalDeclarationsBetweenFiles() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/moveExternalDeclarationsBetweenFiles/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("moveExternalDeclarationsBetweenJsModules")
|
||||
public void testMoveExternalDeclarationsBetweenJsModules() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/moveExternalDeclarationsBetweenJsModules/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("moveFilesBetweenModules")
|
||||
public void testMoveFilesBetweenModules() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/moveFilesBetweenModules/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("moveInlineFunctionBetweenModules")
|
||||
public void testMoveInlineFunctionBetweenModules() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/moveInlineFunctionBetweenModules/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("multiPlatformClashFileNames")
|
||||
public void testMultiPlatformClashFileNames() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/multiPlatformClashFileNames/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("multiPlatformSimple")
|
||||
public void testMultiPlatformSimple() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/multiPlatformSimple/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedClass")
|
||||
public void testNestedClass() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/nestedClass/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonInlineBecomeInline")
|
||||
public void testNonInlineBecomeInline() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/nonInlineBecomeInline/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("openClassWithInternalField")
|
||||
public void testOpenClassWithInternalField() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/openClassWithInternalField/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateDeclarationLeakThroughDefaultParam")
|
||||
public void testPrivateDeclarationLeakThroughDefaultParam() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/privateDeclarationLeakThroughDefaultParam/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateInlineFunction1")
|
||||
public void testPrivateInlineFunction1() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/privateInlineFunction1/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateObjectsLeakThroughSealedInterface")
|
||||
public void testPrivateObjectsLeakThroughSealedInterface() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/privateObjectsLeakThroughSealedInterface/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeFile")
|
||||
public void testRemoveFile() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/removeFile/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeModule")
|
||||
public void testRemoveModule() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/removeModule/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeUnusedFile")
|
||||
public void testRemoveUnusedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/removeUnusedFile/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("renameFile")
|
||||
public void testRenameFile() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/renameFile/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("renameModule")
|
||||
public void testRenameModule() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/renameModule/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/simple/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("splitJoinModule")
|
||||
public void testSplitJoinModule() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/splitJoinModule/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendFunctions")
|
||||
public void testSuspendFunctions() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendGenerator")
|
||||
public void testSuspendGenerator() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendGenerator/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendInterfaceWithDefaultParams")
|
||||
public void testSuspendInterfaceWithDefaultParams() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendInterfaceWithDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("toplevelProperties")
|
||||
public void testToplevelProperties() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/toplevelProperties/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("transitiveInlineFunction")
|
||||
public void testTransitiveInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/transitiveInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeScriptExportsPerFile")
|
||||
public void testTypeScriptExportsPerFile() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/typeScriptExportsPerFile/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeScriptExportsPerModule")
|
||||
public void testTypeScriptExportsPerModule() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/typeScriptExportsPerModule/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unicodeSerializationAndDeserialization")
|
||||
public void testUnicodeSerializationAndDeserialization() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/unicodeSerializationAndDeserialization/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("updateExports")
|
||||
public void testUpdateExports() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/updateExports/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("updateExportsAndInlineImports")
|
||||
public void testUpdateExportsAndInlineImports() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/updateExportsAndInlineImports/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("variance")
|
||||
public void testVariance() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/variance/");
|
||||
}
|
||||
}
|
||||
+597
@@ -0,0 +1,597 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.incremental;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateJsTestsKt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("js/js.translator/testData/incremental/invalidation")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class JsFirES6InvalidationPerModuleTestGenerated extends AbstractJsFirES6InvalidationPerModuleTest {
|
||||
@Test
|
||||
@TestMetadata("abstractClassWithJsExport")
|
||||
public void testAbstractClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/abstractClassWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("addUpdateRemoveDependentFile")
|
||||
public void testAddUpdateRemoveDependentFile() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/addUpdateRemoveDependentFile/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("addUpdateRemoveDependentModule")
|
||||
public void testAddUpdateRemoveDependentModule() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/addUpdateRemoveDependentModule/");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllFilesPresentInInvalidation() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/incremental/invalidation"), Pattern.compile("^([^_](.+))$"), null, TargetBackend.JS_IR_ES6, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("circleExportsUpdate")
|
||||
public void testCircleExportsUpdate() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/circleExportsUpdate/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("circleInlineImportsUpdate")
|
||||
public void testCircleInlineImportsUpdate() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/circleInlineImportsUpdate/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("class")
|
||||
public void testClass() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/class/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classFunctionsAndFields")
|
||||
public void testClassFunctionsAndFields() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classFunctionsAndFields/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classWithJsExport")
|
||||
public void testClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionConstVal")
|
||||
public void testCompanionConstVal() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/companionConstVal/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionFunction")
|
||||
public void testCompanionFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/companionFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionInlineFunction")
|
||||
public void testCompanionInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/companionInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionProperties")
|
||||
public void testCompanionProperties() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/companionProperties/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionWithStdLibCall")
|
||||
public void testCompanionWithStdLibCall() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/companionWithStdLibCall/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("constVals")
|
||||
public void testConstVals() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/constVals/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("crossModuleReferences")
|
||||
public void testCrossModuleReferences() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/crossModuleReferences/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("eagerInitialization")
|
||||
public void testEagerInitialization() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/eagerInitialization/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enum")
|
||||
public void testEnum() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/enum/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumsInInlineFunctions")
|
||||
public void testEnumsInInlineFunctions() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/enumsInInlineFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exceptionsFromInlineFunction")
|
||||
public void testExceptionsFromInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/exceptionsFromInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportsThroughInlineFunction")
|
||||
public void testExportsThroughInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/exportsThroughInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideClassFunctionQualifiers")
|
||||
public void testFakeOverrideClassFunctionQualifiers() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fakeOverrideClassFunctionQualifiers/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideInheritance")
|
||||
public void testFakeOverrideInheritance() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fakeOverrideInheritance/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideInlineExtension")
|
||||
public void testFakeOverrideInlineExtension() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fakeOverrideInlineExtension/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideInlineFunction")
|
||||
public void testFakeOverrideInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fakeOverrideInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideInlineProperty")
|
||||
public void testFakeOverrideInlineProperty() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fakeOverrideInlineProperty/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideInterfaceFunctionQualifiers")
|
||||
public void testFakeOverrideInterfaceFunctionQualifiers() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fakeOverrideInterfaceFunctionQualifiers/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fastPath1")
|
||||
public void testFastPath1() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fastPath1/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fastPath2")
|
||||
public void testFastPath2() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fastPath2/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fileNameClash")
|
||||
public void testFileNameClash() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/fileNameClash/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("friendDependency")
|
||||
public void testFriendDependency() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/friendDependency/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionDefaultParams")
|
||||
public void testFunctionDefaultParams() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/functionDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionSignature")
|
||||
public void testFunctionSignature() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/functionSignature/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionTypeInterface")
|
||||
public void testFunctionTypeInterface() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/functionTypeInterface/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionTypeInterfaceReflect")
|
||||
public void testFunctionTypeInterfaceReflect() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/functionTypeInterfaceReflect/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericFunctions")
|
||||
public void testGenericFunctions() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/genericFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericInlineFunctions")
|
||||
public void testGenericInlineFunctions() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/genericInlineFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("gettersAndSettersInlining")
|
||||
public void testGettersAndSettersInlining() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/gettersAndSettersInlining/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineBecomeNonInline")
|
||||
public void testInlineBecomeNonInline() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineBecomeNonInline/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunctionAnnotations")
|
||||
public void testInlineFunctionAnnotations() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionAnnotations/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunctionAsFunctionReference")
|
||||
public void testInlineFunctionAsFunctionReference() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionAsFunctionReference/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunctionAsParam")
|
||||
public void testInlineFunctionAsParam() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionAsParam/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunctionCircleUsage")
|
||||
public void testInlineFunctionCircleUsage() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionCircleUsage/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunctionDefaultParams")
|
||||
public void testInlineFunctionDefaultParams() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineFunctionWithObject")
|
||||
public void testInlineFunctionWithObject() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionWithObject/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceOpenMethods")
|
||||
public void testInterfaceOpenMethods() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceOpenMethods/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceOpenMethodsInOpenClass")
|
||||
public void testInterfaceOpenMethodsInOpenClass() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceOpenMethodsInOpenClass/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceSuperUsage")
|
||||
public void testInterfaceSuperUsage() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceWithDefaultParams")
|
||||
public void testInterfaceWithDefaultParams() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceWithJsExport")
|
||||
public void testInterfaceWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsCode")
|
||||
public void testJsCode() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsCode/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsCodeWithConstString")
|
||||
public void testJsCodeWithConstString() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsCodeWithConstString/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsCodeWithConstStringFromOtherModule")
|
||||
public void testJsCodeWithConstStringFromOtherModule() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsCodeWithConstStringFromOtherModule/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsExport")
|
||||
public void testJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsExportReexport")
|
||||
public void testJsExportReexport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsExportReexport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsExportWithMultipleFiles")
|
||||
public void testJsExportWithMultipleFiles() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsExportWithMultipleFiles/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsModuleAnnotation")
|
||||
public void testJsModuleAnnotation() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsModuleAnnotation/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsModuleAnnotationOnObjectWithUsage")
|
||||
public void testJsModuleAnnotationOnObjectWithUsage() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsModuleAnnotationOnObjectWithUsage/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsName")
|
||||
public void testJsName() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsName/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinTest")
|
||||
public void testKotlinTest() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/kotlinTest/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("languageVersionSettings")
|
||||
public void testLanguageVersionSettings() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/languageVersionSettings/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("localInlineFunction")
|
||||
public void testLocalInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/localInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("localObjectsLeakThroughInterface")
|
||||
public void testLocalObjectsLeakThroughInterface() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/localObjectsLeakThroughInterface/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mainFunction")
|
||||
public void testMainFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/mainFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mainModuleInvalidation")
|
||||
public void testMainModuleInvalidation() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/mainModuleInvalidation/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("moveAndModifyInlineFunction")
|
||||
public void testMoveAndModifyInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/moveAndModifyInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("moveExternalDeclarationsBetweenFiles")
|
||||
public void testMoveExternalDeclarationsBetweenFiles() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/moveExternalDeclarationsBetweenFiles/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("moveExternalDeclarationsBetweenJsModules")
|
||||
public void testMoveExternalDeclarationsBetweenJsModules() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/moveExternalDeclarationsBetweenJsModules/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("moveFilesBetweenModules")
|
||||
public void testMoveFilesBetweenModules() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/moveFilesBetweenModules/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("moveInlineFunctionBetweenModules")
|
||||
public void testMoveInlineFunctionBetweenModules() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/moveInlineFunctionBetweenModules/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("multiPlatformClashFileNames")
|
||||
public void testMultiPlatformClashFileNames() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/multiPlatformClashFileNames/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("multiPlatformSimple")
|
||||
public void testMultiPlatformSimple() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/multiPlatformSimple/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedClass")
|
||||
public void testNestedClass() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/nestedClass/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonInlineBecomeInline")
|
||||
public void testNonInlineBecomeInline() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/nonInlineBecomeInline/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("openClassWithInternalField")
|
||||
public void testOpenClassWithInternalField() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/openClassWithInternalField/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateDeclarationLeakThroughDefaultParam")
|
||||
public void testPrivateDeclarationLeakThroughDefaultParam() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/privateDeclarationLeakThroughDefaultParam/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateInlineFunction1")
|
||||
public void testPrivateInlineFunction1() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/privateInlineFunction1/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateObjectsLeakThroughSealedInterface")
|
||||
public void testPrivateObjectsLeakThroughSealedInterface() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/privateObjectsLeakThroughSealedInterface/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeFile")
|
||||
public void testRemoveFile() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/removeFile/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeModule")
|
||||
public void testRemoveModule() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/removeModule/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeUnusedFile")
|
||||
public void testRemoveUnusedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/removeUnusedFile/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("renameFile")
|
||||
public void testRenameFile() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/renameFile/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("renameModule")
|
||||
public void testRenameModule() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/renameModule/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/simple/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("splitJoinModule")
|
||||
public void testSplitJoinModule() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/splitJoinModule/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendFunctions")
|
||||
public void testSuspendFunctions() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendGenerator")
|
||||
public void testSuspendGenerator() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendGenerator/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendInterfaceWithDefaultParams")
|
||||
public void testSuspendInterfaceWithDefaultParams() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendInterfaceWithDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("toplevelProperties")
|
||||
public void testToplevelProperties() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/toplevelProperties/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("transitiveInlineFunction")
|
||||
public void testTransitiveInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/transitiveInlineFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeScriptExportsPerFile")
|
||||
public void testTypeScriptExportsPerFile() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/typeScriptExportsPerFile/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeScriptExportsPerModule")
|
||||
public void testTypeScriptExportsPerModule() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/typeScriptExportsPerModule/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unicodeSerializationAndDeserialization")
|
||||
public void testUnicodeSerializationAndDeserialization() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/unicodeSerializationAndDeserialization/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("updateExports")
|
||||
public void testUpdateExports() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/updateExports/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("updateExportsAndInlineImports")
|
||||
public void testUpdateExportsAndInlineImports() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/updateExportsAndInlineImports/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("variance")
|
||||
public void testVariance() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/variance/");
|
||||
}
|
||||
}
|
||||
Generated
+6
@@ -535,6 +535,12 @@ public class JsFirInvalidationPerFileTestGenerated extends AbstractJsFirInvalida
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendGenerator")
|
||||
public void testSuspendGenerator() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendGenerator/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendInterfaceWithDefaultParams")
|
||||
public void testSuspendInterfaceWithDefaultParams() throws Exception {
|
||||
|
||||
Generated
+6
@@ -535,6 +535,12 @@ public class JsFirInvalidationPerModuleTestGenerated extends AbstractJsFirInvali
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendGenerator")
|
||||
public void testSuspendGenerator() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendGenerator/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendInterfaceWithDefaultParams")
|
||||
public void testSuspendInterfaceWithDefaultParams() throws Exception {
|
||||
|
||||
Generated
+6
@@ -535,6 +535,12 @@ public class JsIrES6InvalidationPerFileTestGenerated extends AbstractJsIrES6Inva
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendGenerator")
|
||||
public void testSuspendGenerator() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendGenerator/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendInterfaceWithDefaultParams")
|
||||
public void testSuspendInterfaceWithDefaultParams() throws Exception {
|
||||
|
||||
+6
@@ -535,6 +535,12 @@ public class JsIrES6InvalidationPerModuleTestGenerated extends AbstractJsIrES6In
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendGenerator")
|
||||
public void testSuspendGenerator() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendGenerator/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendInterfaceWithDefaultParams")
|
||||
public void testSuspendInterfaceWithDefaultParams() throws Exception {
|
||||
|
||||
Generated
+6
@@ -535,6 +535,12 @@ public class JsIrInvalidationPerFileTestGenerated extends AbstractJsIrInvalidati
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendGenerator")
|
||||
public void testSuspendGenerator() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendGenerator/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendInterfaceWithDefaultParams")
|
||||
public void testSuspendInterfaceWithDefaultParams() throws Exception {
|
||||
|
||||
Generated
+6
@@ -535,6 +535,12 @@ public class JsIrInvalidationPerModuleTestGenerated extends AbstractJsIrInvalida
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendFunctions/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendGenerator")
|
||||
public void testSuspendGenerator() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/suspendGenerator/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendInterfaceWithDefaultParams")
|
||||
public void testSuspendInterfaceWithDefaultParams() throws Exception {
|
||||
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
import kotlin.coroutines.*
|
||||
|
||||
abstract class Generator<T> {
|
||||
private var generatorContinuation: Continuation<Unit>? = null
|
||||
private var callerContinuation: Continuation<T>? = null
|
||||
|
||||
fun resetGenerator() {
|
||||
this::initGenerator.startCoroutine(object: Continuation<Unit> {
|
||||
override val context = EmptyCoroutineContext
|
||||
override fun resumeWith(result: Result<Unit>) {
|
||||
result.getOrThrow()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
suspend fun yieldValue(x: T) {
|
||||
suspendCoroutine { continuation ->
|
||||
generatorContinuation = continuation
|
||||
callerContinuation?.resume(x)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun initGenerator() {
|
||||
suspendCoroutine { continuation ->
|
||||
generatorContinuation = continuation
|
||||
}
|
||||
|
||||
generatorBody()
|
||||
|
||||
generatorContinuation = null
|
||||
}
|
||||
|
||||
protected abstract suspend fun generatorBody()
|
||||
|
||||
fun hasNext(): Boolean {
|
||||
return generatorContinuation != null
|
||||
}
|
||||
|
||||
suspend fun nextValue(): T {
|
||||
return suspendCoroutine { continuation ->
|
||||
callerContinuation = continuation
|
||||
generatorContinuation?.resume(Unit)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ClosedRangeGenerator(
|
||||
private val rangeStart: Int,
|
||||
private val rangeEnd: Int,
|
||||
private val step: Int
|
||||
) : Generator<Int>() {
|
||||
override suspend fun generatorBody() {
|
||||
for (i in IntProgression.fromClosedRange(rangeStart, rangeEnd, step)) {
|
||||
yieldValue(i)
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
STEP 0:
|
||||
modifications:
|
||||
U : generator.0.kt -> generator.kt
|
||||
added file: generator.kt
|
||||
STEP 1:
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
STEP 0:
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : test.0.kt -> test.kt
|
||||
added file: test.kt
|
||||
STEP 1:
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : test.1.kt -> test.kt
|
||||
modified ir: test.kt
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
import kotlin.coroutines.*
|
||||
|
||||
private fun runCoroutine(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context = EmptyCoroutineContext
|
||||
override fun resumeWith(result: Result<Unit>) {
|
||||
result.getOrThrow()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun test(): Int {
|
||||
val generator = ClosedRangeGenerator(0, 0, 1)
|
||||
generator.resetGenerator()
|
||||
var s = 0
|
||||
runCoroutine {
|
||||
while(generator.hasNext()) {
|
||||
s += generator.nextValue()
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
import kotlin.coroutines.*
|
||||
|
||||
private fun runCoroutine(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context = EmptyCoroutineContext
|
||||
override fun resumeWith(result: Result<Unit>) {
|
||||
result.getOrThrow()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun test(): Int {
|
||||
val generator = ClosedRangeGenerator(0, 1, 1)
|
||||
generator.resetGenerator()
|
||||
var s = 0
|
||||
runCoroutine {
|
||||
while(generator.hasNext()) {
|
||||
s += generator.nextValue()
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun box(stepId: Int): String {
|
||||
val got = test()
|
||||
if (got != stepId) {
|
||||
return "Fail: $got != $stepId"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
STEP 0:
|
||||
dependencies: lib1, lib2
|
||||
added file: m.kt
|
||||
STEP 1:
|
||||
dependencies: lib1, lib2
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
dirty js modules: lib1, lib2, main
|
||||
dirty js files: lib1/generator, lib2/test, main/m, main/m.export, main
|
||||
STEP 1:
|
||||
libs: lib1, lib2, main
|
||||
dirty js modules: lib2
|
||||
dirty js files: lib2/test
|
||||
Vendored
+16
-1
@@ -1,3 +1,5 @@
|
||||
import kotlin.coroutines.*
|
||||
|
||||
internal suspend fun testDefaltParam(stepId: Int): Int {
|
||||
return callFun(ClassA2())
|
||||
}
|
||||
@@ -8,9 +10,22 @@ private suspend fun callFun(a: InterfaceA): Int {
|
||||
return a.functionA(0, "", false)
|
||||
}
|
||||
|
||||
suspend fun box(stepId: Int): String {
|
||||
suspend fun suspendBox(stepId: Int): String {
|
||||
if (testDefaltParam(stepId) != stepId) {
|
||||
return "Fail"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
|
||||
fun runCoroutine(coroutine: suspend () -> String): String {
|
||||
var result: String = "Uninitialized"
|
||||
coroutine.startCoroutine(object : Continuation<String> {
|
||||
override val context = EmptyCoroutineContext
|
||||
override fun resumeWith(r: Result<String>) {
|
||||
result = r.getOrThrow()
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
fun box(stepId: Int) = runCoroutine { suspendBox(stepId) }
|
||||
Reference in New Issue
Block a user