From ca4d3476580319885ae484a42af5810bb37a3550 Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Mon, 16 Dec 2013 21:48:57 +0400 Subject: [PATCH] JS backend: minor -- move test for KT-2388 to ClosureTest. --- .../k2js/test/semantics/ClosureTest.java | 4 ++++ .../test/semantics/NativeInteropTest.java | 4 ---- .../cases/closureThisInConstructor.kt} | 6 ++---- .../testFiles/native/native/kt_2388.js | 19 ------------------- 4 files changed, 6 insertions(+), 27 deletions(-) rename js/js.translator/testFiles/{native/cases/kt_2388.kt => closure/cases/closureThisInConstructor.kt} (70%) delete mode 100644 js/js.translator/testFiles/native/native/kt_2388.js diff --git a/js/js.tests/test/org/jetbrains/k2js/test/semantics/ClosureTest.java b/js/js.tests/test/org/jetbrains/k2js/test/semantics/ClosureTest.java index 2755ff2697e..a131cc61609 100644 --- a/js/js.tests/test/org/jetbrains/k2js/test/semantics/ClosureTest.java +++ b/js/js.tests/test/org/jetbrains/k2js/test/semantics/ClosureTest.java @@ -68,4 +68,8 @@ public final class ClosureTest extends SingleFileTranslationTest { public void igonre_testClosureLocalFunctionByInnerFunctionInConstrunctor() throws Exception { checkFooBoxIsOk(); } + + public void testClosureThisInConstructor() throws Exception { + fooBoxTest(); + } } diff --git a/js/js.tests/test/org/jetbrains/k2js/test/semantics/NativeInteropTest.java b/js/js.tests/test/org/jetbrains/k2js/test/semantics/NativeInteropTest.java index 093c1f0fb02..6db6976d229 100644 --- a/js/js.tests/test/org/jetbrains/k2js/test/semantics/NativeInteropTest.java +++ b/js/js.tests/test/org/jetbrains/k2js/test/semantics/NativeInteropTest.java @@ -81,10 +81,6 @@ public final class NativeInteropTest extends SingleFileTranslationTest { fooBoxTest(); } - public void testKt_2388() throws Exception { - fooBoxTest(); - } - public void testKt2323() throws Exception { fooBoxTest(); } diff --git a/js/js.translator/testFiles/native/cases/kt_2388.kt b/js/js.translator/testFiles/closure/cases/closureThisInConstructor.kt similarity index 70% rename from js/js.translator/testFiles/native/cases/kt_2388.kt rename to js/js.translator/testFiles/closure/cases/closureThisInConstructor.kt index 1938b7044a5..4d0e0425eef 100644 --- a/js/js.translator/testFiles/native/cases/kt_2388.kt +++ b/js/js.translator/testFiles/closure/cases/closureThisInConstructor.kt @@ -1,8 +1,6 @@ +// KT-2388 package foo -native -fun _setTimeout(callback:()->Unit):Unit = noImpl - var done = false object foo { @@ -15,6 +13,6 @@ object foo { } fun box(): Boolean { - _setTimeout(foo.callbackWrapper) + foo.callbackWrapper() return foo.timeoutId == -1 as Long } diff --git a/js/js.translator/testFiles/native/native/kt_2388.js b/js/js.translator/testFiles/native/native/kt_2388.js deleted file mode 100644 index 2aee0a39d09..00000000000 --- a/js/js.translator/testFiles/native/native/kt_2388.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function _setTimeout(callback) { - callback.call({}); -}