Added simple method call support.

This commit is contained in:
Pavel Talanov
2011-11-09 20:29:51 +04:00
parent f3d8b2c3b1
commit da1a1a3727
9 changed files with 343 additions and 251 deletions
+272 -240
View File
@@ -6,12 +6,15 @@
</component>
<component name="ChangeListManager">
<list default="true" id="f02ef53d-47a4-4f5e-a1aa-3df68aae9b20" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/translator/test_files/test_cases/mehodDeclarationAndCall.kt" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/translator/test_files/test_cases/accessToInstanceProperty.kt" />
<change type="MOVED" beforePath="C:\Dev\Projects\jet-contrib\k2js\translator\test_files\test_cases\mehodDeclarationAndCall.kt" afterPath="$PROJECT_DIR$/translator/test_files/test_cases/methodDeclarationAndCall.kt" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/src/com/google/dart/compiler/backend/js/ast/JsNew.java" afterPath="$PROJECT_DIR$/js/src/com/google/dart/compiler/backend/js/ast/JsNew.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ClassBodyVisitor.java" afterPath="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ClassBodyVisitor.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ClassTranslator.java" afterPath="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ClassTranslator.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ExpressionVisitor.java" afterPath="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ExpressionVisitor.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/FunctionTranslator.java" afterPath="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/FunctionTranslator.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/TranslationContext.java" afterPath="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/TranslationContext.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/translator/test/org/jetbrains/k2js/test/ClassTest.java" afterPath="$PROJECT_DIR$/translator/test/org/jetbrains/k2js/test/ClassTest.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/translator/test_files/test_cases/classInstantiation.js" afterPath="$PROJECT_DIR$/translator/test_files/test_cases/classInstantiation.js" />
</list>
<ignored path="k2js.iws" />
<ignored path=".idea/workspace.xml" />
@@ -36,7 +39,7 @@
</component>
<component name="DebuggerManager">
<line_breakpoints>
<breakpoint url="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ExpressionVisitor.java" line="153" class="org.jetbrains.k2js.translate.ExpressionVisitor" package="org.jetbrains.k2js.translate">
<breakpoint url="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ExpressionVisitor.java" line="282" class="org.jetbrains.k2js.translate.ExpressionVisitor" package="org.jetbrains.k2js.translate">
<option name="ENABLED" value="true" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
@@ -89,42 +92,13 @@
<favorites_list name="k2js" />
</component>
<component name="FileEditorManager">
<splitter split-orientation="horizontal" split-proportion="0.37563777">
<splitter split-orientation="horizontal" split-proportion="0.49043366">
<split-first>
<leaf>
<file leaf-file-name="NameFactory.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/js/src/com/google/dart/compiler/common/NameFactory.java">
<provider selected="true" editor-type-id="text-editor">
<state line="6" column="36" selection-start="295" selection-end="295" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="AstUtil.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/js/src/com/google/dart/compiler/util/AstUtil.java">
<provider selected="true" editor-type-id="text-editor">
<state line="170" column="27" selection-start="5517" selection-end="5517" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="NamespaceTranslator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/NamespaceTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="2" column="48" selection-start="87" selection-end="87" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ClassTranslator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ClassTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="46" column="13" selection-start="2102" selection-end="2102" vertical-scroll-proportion="0.0">
<state line="43" column="62" selection-start="2003" selection-end="2003" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
@@ -132,46 +106,73 @@
</provider>
</entry>
</file>
<file leaf-file-name="Reader.java" pinned="false" current="false" current-in-tab="false">
<entry file="jar://C:/Program Files/Java/jdk1.7.0_01/src.zip!/java/io/Reader.java">
<file leaf-file-name="TranslationContext.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/TranslationContext.java">
<provider selected="true" editor-type-id="text-editor">
<state line="77" column="0" selection-start="1684" selection-end="1684" vertical-scroll-proportion="0.0">
<state line="60" column="46" selection-start="2250" selection-end="2250" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="JetStandardLibrary.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/types/JetStandardLibrary.java">
<file leaf-file-name="OperationTranslator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/OperationTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="48" column="14" selection-start="1890" selection-end="1890" vertical-scroll-proportion="0.0">
<state line="13" column="19" selection-start="348" selection-end="348" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ClassTest.java" pinned="false" current="true" current-in-tab="true">
<file leaf-file-name="ClassTest.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/translator/test/org/jetbrains/k2js/test/ClassTest.java">
<provider selected="true" editor-type-id="text-editor">
<state line="51" column="50" selection-start="1774" selection-end="1774" vertical-scroll-proportion="0.9005848">
<state line="57" column="36" selection-start="1922" selection-end="1922" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="testKotlinLib.js" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/translator/test_files/test_cases/testKotlinLib.js">
<file leaf-file-name="NamespaceDescriptor.java" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/NamespaceDescriptor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="12" column="58" selection-start="176" selection-end="176" vertical-scroll-proportion="0.0">
<state line="17" column="24" selection-start="472" selection-end="472" vertical-scroll-proportion="0.4524715">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="mehodDeclarationAndCall.kt" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/translator/test_files/test_cases/mehodDeclarationAndCall.kt">
<file leaf-file-name="methodDeclarationAndCall.js" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/translator/test_files/test_cases/methodDeclarationAndCall.js">
<provider selected="true" editor-type-id="text-editor">
<state line="10" column="22" selection-start="155" selection-end="155" vertical-scroll-proportion="0.0">
<state line="12" column="39" selection-start="216" selection-end="216" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="DeclarationDescriptor.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/DeclarationDescriptor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="26" column="30" selection-start="998" selection-end="998" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="DeclarationDescriptorVisitor.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="14" column="23" selection-start="404" selection-end="404" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="accessToInstanceProperty.kt" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/translator/test_files/test_cases/accessToInstanceProperty.kt">
<provider selected="true" editor-type-id="text-editor">
<state line="8" column="23" selection-start="120" selection-end="120" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -190,10 +191,10 @@
</split-first>
<split-second>
<leaf>
<file leaf-file-name="ExpressionVisitor.java" pinned="false" current="false" current-in-tab="false">
<file leaf-file-name="ExpressionVisitor.java" pinned="false" current="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ExpressionVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="132" column="27" selection-start="5694" selection-end="5694" vertical-scroll-proportion="-4.0384617">
<state line="107" column="0" selection-start="4543" selection-end="4543" vertical-scroll-proportion="0.33333334">
<folding>
<element signature="imports" expanded="true" />
</folding>
@@ -201,64 +202,28 @@
</provider>
</entry>
</file>
<file leaf-file-name="classInstantiation.js" pinned="false" current="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/translator/test_files/test_cases/classInstantiation.js">
<file leaf-file-name="JsInvocation.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/js/src/com/google/dart/compiler/backend/js/ast/JsInvocation.java">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<state line="25" column="24" selection-start="706" selection-end="706" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="BindingContext.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContext.java">
<file leaf-file-name="JsNameRef.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/js/src/com/google/dart/compiler/backend/js/ast/JsNameRef.java">
<provider selected="true" editor-type-id="text-editor">
<state line="8" column="52" selection-start="376" selection-end="384" vertical-scroll-proportion="2.6153846">
<state line="9" column="19" selection-start="356" selection-end="356" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="JsNew.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/js/src/com/google/dart/compiler/backend/js/ast/JsNew.java">
<file leaf-file-name="JetQualifiedExpression.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetQualifiedExpression.java">
<provider selected="true" editor-type-id="text-editor">
<state line="21" column="32" selection-start="652" selection-end="652" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="HasArguments.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/js/src/com/google/dart/compiler/backend/js/ast/HasArguments.java">
<provider selected="true" editor-type-id="text-editor">
<state line="11" column="17" selection-start="376" selection-end="376" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ResolvedCall.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCall.java">
<provider selected="true" editor-type-id="text-editor">
<state line="21" column="17" selection-start="770" selection-end="770" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ResolvedCallImpl.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java">
<provider selected="true" editor-type-id="text-editor">
<state line="95" column="13" selection-start="3636" selection-end="3636" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="stringAssignment.kt" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/translator/test_files/test_cases/stringAssignment.kt">
<provider selected="true" editor-type-id="text-editor">
<state line="4" column="16" selection-start="54" selection-end="54" vertical-scroll-proportion="0.0">
<state line="10" column="103" selection-start="294" selection-end="294" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -267,16 +232,58 @@
<file leaf-file-name="JetVisitor.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="334" column="25" selection-start="10982" selection-end="10994" vertical-scroll-proportion="-6.6538463">
<state line="34" column="0" selection-start="941" selection-end="941" vertical-scroll-proportion="-6.6538463">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="JetNamedFunction.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamedFunction.java">
<provider selected="true" editor-type-id="text-editor">
<state line="22" column="0" selection-start="555" selection-end="555" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ClassBodyVisitor.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ClassBodyVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="36" column="92" selection-start="1286" selection-end="1286" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="AstUtil.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/js/src/com/google/dart/compiler/util/AstUtil.java">
<provider selected="true" editor-type-id="text-editor">
<state line="19" column="23" selection-start="689" selection-end="694" vertical-scroll-proportion="-6.6538463">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="FunctionTranslator.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/FunctionTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="19" column="74" selection-start="576" selection-end="576" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="FunctionTest.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/translator/test/org/jetbrains/k2js/test/FunctionTest.java">
<provider selected="true" editor-type-id="text-editor">
<state line="23" column="16" selection-start="536" selection-end="536" vertical-scroll-proportion="0.0">
<state line="10" column="19" selection-start="250" selection-end="250" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -298,22 +305,22 @@
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
<option value="$PROJECT_DIR$/js/src/com/google/dart/compiler/backend/js/ast/JsScope.java" />
<option value="$PROJECT_DIR$/translator/test/org/jetbrains/k2js/test/TranslationTest.java" />
<option value="$PROJECT_DIR$/translator/test_files/test_cases/elseif.kt" />
<option value="$PROJECT_DIR$/translator/test_files/test_cases/while.kt" />
<option value="$PROJECT_DIR$/translator/test_files/test_cases/doWhile.kt" />
<option value="$PROJECT_DIR$/translator/test_files/test_cases/whileDoesntExecute.kt" />
<option value="$PROJECT_DIR$/translator/test_files/test_cases/doWhileExecutes.kt" />
<option value="$PROJECT_DIR$/translator/test_files/test_cases/doWhile2.kt" />
<option value="$PROJECT_DIR$/translator/test_files/test_cases/stringConstant.kt" />
<option value="$PROJECT_DIR$/translator/test_files/test_cases/stringAssignment.kt" />
<option value="$PROJECT_DIR$/translator/test/org/jetbrains/k2js/test/FunctionTest.java" />
<option value="$PROJECT_DIR$/translator/test_files/test_cases/classInstantiation.js" />
<option value="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ExpressionVisitor.java" />
<option value="$PROJECT_DIR$/js/src/com/google/dart/compiler/backend/js/ast/JsNew.java" />
<option value="$PROJECT_DIR$/translator/test_files/test_cases/mehodDeclarationAndCall.kt" />
<option value="$PROJECT_DIR$/translator/test_files/test_cases/methodDeclarationAndCall.kt" />
<option value="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/FunctionTranslator.java" />
<option value="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ClassBodyVisitor.java" />
<option value="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ExpressionVisitor.java" />
<option value="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/TranslationContext.java" />
<option value="$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ClassTranslator.java" />
<option value="$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/DeclarationDescriptor.java" />
<option value="$PROJECT_DIR$/translator/test_files/test_cases/classInstantiation.kt" />
<option value="$PROJECT_DIR$/translator/test_files/test_cases/classWithProperties.kt" />
<option value="$PROJECT_DIR$/translator/test/org/jetbrains/k2js/test/ClassTest.java" />
<option value="$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/NamespaceDescriptor.java" />
</list>
</option>
</component>
@@ -434,7 +441,19 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="js" />
<option name="myItemId" value="translator" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="k2js" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="translate" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -530,72 +549,6 @@
</key>
</component>
<component name="RunManager" selected="JUnit.ClassTest">
<configuration default="false" name="FunctionTest" type="JUnit" factoryName="JUnit" temporary="true">
<module name="translator" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="PACKAGE_NAME" value="org.jetbrains.k2js.test" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.k2js.test.FunctionTest" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/translator" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="false" name="All in translator" type="JUnit" factoryName="JUnit" temporary="true">
<module name="translator" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/translator" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="false" name="FunctionTest.doWhileExecutes" type="JUnit" factoryName="JUnit" temporary="true">
<module name="translator" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.k2js.test" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.k2js.test.FunctionTest" />
<option name="METHOD_NAME" value="doWhileExecutes" />
<option name="TEST_OBJECT" value="method" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="false" name="ClassTest.classInstantiation" type="JUnit" factoryName="JUnit" temporary="true">
<module name="translator" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -646,6 +599,80 @@
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="false" name="Temp suite" type="JUnit" factoryName="JUnit" temporary="true">
<module name="translator" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="PACKAGE_NAME" value="org.jetbrains.k2js.test" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="pattern" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/translator" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="50097" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<ConfigurationWrapper RunnerId="Debug" />
<method />
</configuration>
<configuration default="false" name="ClassTest.methodDeclarationAndCall" type="JUnit" factoryName="JUnit" temporary="true">
<module name="translator" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="PACKAGE_NAME" value="org.jetbrains.k2js.test" />
<option name="MAIN_CLASS_NAME" value="org.jetbrains.k2js.test.ClassTest" />
<option name="METHOD_NAME" value="methodDeclarationAndCall" />
<option name="TEST_OBJECT" value="method" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/translator" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="50132" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<ConfigurationWrapper RunnerId="Debug" />
<method />
</configuration>
<configuration default="false" name="All in translator" type="JUnit" factoryName="JUnit" temporary="true">
<module name="translator" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/translator" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
@@ -721,11 +748,11 @@
</method>
</configuration>
<list size="5">
<item index="0" class="java.lang.String" itemvalue="JUnit.FunctionTest" />
<item index="1" class="java.lang.String" itemvalue="JUnit.All in translator" />
<item index="2" class="java.lang.String" itemvalue="JUnit.FunctionTest.doWhileExecutes" />
<item index="3" class="java.lang.String" itemvalue="JUnit.ClassTest.classInstantiation" />
<item index="4" class="java.lang.String" itemvalue="JUnit.ClassTest" />
<item index="0" class="java.lang.String" itemvalue="JUnit.ClassTest.classInstantiation" />
<item index="1" class="java.lang.String" itemvalue="JUnit.ClassTest" />
<item index="2" class="java.lang.String" itemvalue="JUnit.Temp suite" />
<item index="3" class="java.lang.String" itemvalue="JUnit.ClassTest.methodDeclarationAndCall" />
<item index="4" class="java.lang.String" itemvalue="JUnit.All in translator" />
</list>
<configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
@@ -761,7 +788,7 @@
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1176" extended-state="6" />
<editor active="false" />
<editor active="true" />
<layout>
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32907662" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
@@ -777,7 +804,7 @@
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3997862" sideWeight="0.6705998" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.16149732" sideWeight="0.5699234" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.43007663" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.43007663" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
@@ -815,7 +842,7 @@
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
<option name="DEFAULT_PATCH_EXTENSION" value="patch" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
<option name="LAST_COMMIT_MESSAGE" value="Added string constant support." />
<option name="LAST_COMMIT_MESSAGE" value="Added constructor calls. Working on method logic." />
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
@@ -835,6 +862,7 @@
<MESSAGE value="Added if else support" />
<MESSAGE value="Added while/do while support" />
<MESSAGE value="Added string constant support." />
<MESSAGE value="Added constructor calls. Working on method logic." />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
@@ -844,76 +872,48 @@
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.java">
<entry file="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ClassBodyVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="95" column="13" selection-start="3636" selection-end="3636" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="334" column="25" selection-start="10982" selection-end="10994" vertical-scroll-proportion="-6.6538463">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/translator/test/org/jetbrains/k2js/test/FunctionTest.java">
<provider selected="true" editor-type-id="text-editor">
<state line="23" column="16" selection-start="536" selection-end="536" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContext.java">
<provider selected="true" editor-type-id="text-editor">
<state line="8" column="52" selection-start="376" selection-end="384" vertical-scroll-proportion="2.6153846">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetIfExpression.java">
<provider selected="true" editor-type-id="text-editor">
<state line="38" column="29" selection-start="979" selection-end="979" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/js/src/com/google/dart/compiler/backend/js/ast/JsProgram.java">
<provider selected="true" editor-type-id="text-editor">
<state line="158" column="36" selection-start="4292" selection-end="4292" vertical-scroll-proportion="0.0">
<state line="36" column="92" selection-start="1286" selection-end="1286" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/js/src/com/google/dart/compiler/backend/js/ast/HasArguments.java">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDotQualifiedExpression.java">
<provider selected="true" editor-type-id="text-editor">
<state line="11" column="17" selection-start="376" selection-end="376" vertical-scroll-proportion="0.0">
<state line="8" column="53" selection-start="190" selection-end="190" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/js/src/com/google/dart/compiler/backend/js/ast/JsNew.java">
<entry file="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ClassTranslator.java">
<provider selected="true" editor-type-id="text-editor">
<state line="21" column="32" selection-start="652" selection-end="652" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ExpressionVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="132" column="27" selection-start="5694" selection-end="5694" vertical-scroll-proportion="-4.0384617">
<state line="43" column="62" selection-start="2003" selection-end="2003" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/translator/test_files/test_cases/classInstantiation.js">
<entry file="file://$PROJECT_DIR$/translator/test_files/test_cases/methodDeclarationAndCall.js">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<state line="12" column="39" selection-start="216" selection-end="216" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/types/JetStandardLibrary.java">
<provider selected="true" editor-type-id="text-editor">
<state line="48" column="14" selection-start="1890" selection-end="1890" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/DeclarationDescriptor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="26" column="30" selection-start="998" selection-end="998" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -925,16 +925,16 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/translator/test_files/test_cases/while2.js">
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="2" column="8" selection-start="34" selection-end="131" vertical-scroll-proportion="0.0">
<state line="14" column="23" selection-start="404" selection-end="404" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/translator/test_files/test_cases/stringConstant.kt">
<entry file="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/TranslatorVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="8" column="45" selection-start="80" selection-end="80" vertical-scroll-proportion="0.0">
<state line="17" column="0" selection-start="537" selection-end="537" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -946,16 +946,48 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/translator/test_files/test_cases/mehodDeclarationAndCall.kt">
<entry file="file://$PROJECT_DIR$/translator/test_files/test_cases/accessToInstanceProperty.kt">
<provider selected="true" editor-type-id="text-editor">
<state line="10" column="22" selection-start="155" selection-end="155" vertical-scroll-proportion="0.0">
<state line="8" column="23" selection-start="120" selection-end="120" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/js/src/com/google/dart/compiler/util/AstUtil.java">
<provider selected="true" editor-type-id="text-editor">
<state line="19" column="23" selection-start="689" selection-end="694" vertical-scroll-proportion="-6.6538463">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/translator/src/org/jetbrains/k2js/translate/ExpressionVisitor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="107" column="0" selection-start="4543" selection-end="4543" vertical-scroll-proportion="0.33333334">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/translator/test/org/jetbrains/k2js/test/ClassTest.java">
<provider selected="true" editor-type-id="text-editor">
<state line="51" column="50" selection-start="1774" selection-end="1774" vertical-scroll-proportion="0.9005848">
<state line="57" column="36" selection-start="1922" selection-end="1922" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/translator/test_files/test_cases/methodDeclarationAndCall.kt">
<provider selected="true" editor-type-id="text-editor">
<state line="10" column="40" selection-start="157" selection-end="157" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../Kotlin/jet/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/NamespaceDescriptor.java">
<provider selected="true" editor-type-id="text-editor">
<state line="17" column="24" selection-start="472" selection-end="472" vertical-scroll-proportion="0.4524715">
<folding />
</state>
</provider>
@@ -2,11 +2,9 @@ package org.jetbrains.k2js.translate;
import com.google.dart.compiler.backend.js.ast.*;
import com.google.dart.compiler.util.AstUtil;
import com.intellij.util.Function;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetClass;
import org.jetbrains.jet.lang.psi.JetDeclaration;
import org.jetbrains.jet.lang.psi.JetProperty;
import org.jetbrains.jet.lang.psi.JetPropertyAccessor;
import org.jetbrains.jet.lang.psi.*;
import java.util.ArrayList;
import java.util.Arrays;
@@ -27,6 +25,15 @@ public final class ClassBodyVisitor extends TranslatorVisitor<List<JsPropertyIni
return properties;
}
@Override
@NotNull
// method declaration
public List<JsPropertyInitializer> visitNamedFunction(@NotNull JetNamedFunction expression, @NotNull TranslationContext context) {
List<JsPropertyInitializer> properties = new ArrayList<JsPropertyInitializer>();
properties.add((new FunctionTranslator(context)).translateAsMethod(expression));
return properties;
}
@Override
@NotNull
public List<JsPropertyInitializer> visitProperty(@NotNull JetProperty expression, @NotNull TranslationContext context) {
@@ -83,7 +90,6 @@ public final class ClassBodyVisitor extends TranslatorVisitor<List<JsPropertyIni
return jsBackingFieldName;
}
@NotNull
private JsPropertyInitializer generateDefaultSetter(@NotNull JetProperty expression,
@NotNull TranslationContext context) {
@@ -113,6 +119,8 @@ public final class ClassBodyVisitor extends TranslatorVisitor<List<JsPropertyIni
return assignExpression;
}
// @Override
// @NotNull
// public List<JsPropertyInitializer> visitPropertyAccessor
@@ -46,7 +46,7 @@ public final class ClassTranslator extends AbstractTranslator {
private JsObjectLiteral translateClassDeclarations(JetClass classDeclaration) {
List<JsPropertyInitializer> propertyList = new ArrayList<JsPropertyInitializer>();
propertyList.add(generateInitializeMethod(classDeclaration));
propertyList.addAll(classDeclaration.accept(classBodyVisitor, translationContext()));
propertyList.addAll(classDeclaration.accept(classBodyVisitor, translationContext().newClass()));
return new JsObjectLiteral(propertyList);
}
@@ -269,12 +269,36 @@ public final class ExpressionVisitor extends TranslatorVisitor<JsNode> {
context.bindingContext().get(BindingContext.COMPILE_TIME_VALUE, expression);
if (compileTimeValue != null) {
Object value = compileTimeValue.getValue();
assert value instanceof String : "Compile time constant template should be a String constant";
assert value instanceof String : "Compile time constant template should be a String constant.";
String constantString = (String)value;
return context.program().getStringLiteral(constantString);
}
return null;
}
@Override
@NotNull
public JsNode visitDotQualifiedExpression(@NotNull JetDotQualifiedExpression expression,
@NotNull TranslationContext context) {
JsExpression receiver = AstUtil.convertToExpression(expression.getReceiverExpression().accept(this, context));
JetExpression jetSelector = expression.getSelectorExpression();
assert jetSelector != null : "Selector should not be null in dot qualified expression.";
JsExpression selector = AstUtil.convertToExpression(jetSelector.accept(this, context));
assert (selector instanceof JsNameRef || selector instanceof JsInvocation)
: "Selector should be a name reference or a method invocation in dot qualified expression.";
if (selector instanceof JsInvocation) {
JsInvocation result = (JsInvocation)selector;
JsExpression qualifier = result.getQualifier();
JsNameRef nameRef = (JsNameRef)qualifier;
nameRef.setQualifier(receiver);
return result;
} else {
JsNameRef result = (JsNameRef)selector;
result.setQualifier(receiver);
return result;
}
}
}
@@ -27,6 +27,12 @@ public final class FunctionTranslator extends AbstractTranslator {
(translationContext().getNamespaceQualifiedReference(functionName), function));
}
@NotNull JsPropertyInitializer translateAsMethod(@NotNull JetNamedFunction jetFunction) {
JsName functionName = translationContext().namespaceScope().declareFreshName(jetFunction.getName());
JsFunction function = generateFunctionObject(jetFunction);
return new JsPropertyInitializer(functionName.makeRef(), function);
}
@NotNull
private JsFunction generateFunctionObject(@NotNull JetNamedFunction jetFunction) {
JetExpression jetBodyExpression = jetFunction.getBodyExpression();
@@ -58,16 +58,23 @@ public final class TranslationContext {
@NotNull
public TranslationContext newBlock() {
Scopes newScopes = new Scopes(new JsScope
(scopes.enclosingScope, "dummy enclosingScope for a block"), scopes.classScope, scopes.namespaceScope);
(scopes.enclosingScope, "Scope for a block"), scopes.classScope, scopes.namespaceScope);
return new TranslationContext(currentNamespace, program,
bindingContext, newScopes);
}
@NotNull
public TranslationContext newClass() {
JsScope classDummyScope = new JsScope(namespaceScope(), "Scope for a class");
Scopes newScopes = new Scopes(classDummyScope, classDummyScope, scopes.namespaceScope);
return new TranslationContext(currentNamespace, program,
bindingContext, newScopes);
}
//TODO new Class?
@NotNull
public TranslationContext newFunction(@NotNull JsFunction function) {
JsScope functionScope = function.getScope();
Scopes newScopes = new Scopes(functionScope, functionScope, scopes.namespaceScope);
Scopes newScopes = new Scopes(functionScope, scopes.classScope, scopes.namespaceScope);
return new TranslationContext(currentNamespace, program,
bindingContext, newScopes);
}
@@ -52,4 +52,9 @@ public final class ClassTest extends TranslationTest {
testFooBoxIsTrue("methodDeclarationAndCall.kt");
}
@Test
public void accessToInstanceProperty() throws Exception {
testFooBoxIsTrue("accessToInstanceProperty.kt");
}
}
@@ -0,0 +1,10 @@
namespace foo
class Test() {
val a : Int = 1
}
fun box() : Boolean {
var test = Test()
return (test.a == 1)
}
@@ -8,5 +8,5 @@ class Test() {
fun box() : Boolean {
var test = Test()
return test.method
return test.method()
}