Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 134531 Details for
Bug 269055
Object Literal definition is not treated as an Object
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Updates to the InferEngine, ObjectLit resolving, and junit tests
patchFor269055 (text/plain), 9.64 KB, created by
Chris Jaun
on 2009-05-05 17:49:09 EDT
(
hide
)
Description:
Updates to the InferEngine, ObjectLit resolving, and junit tests
Filename:
MIME Type:
Creator:
Chris Jaun
Created:
2009-05-05 17:49:09 EDT
Size:
9.64 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.jsdt.core.tests.compiler >Index: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java,v >retrieving revision 1.22 >diff -u -r1.22 InferTypesTests.java >--- src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java 1 Oct 2008 21:43:40 -0000 1.22 >+++ src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java 5 May 2009 21:49:13 -0000 >@@ -235,7 +235,7 @@ > " b: function(){}};" + > "\n", > "X.js", >- "class MyClass extends Object{\n static Number a;\n static String b()\n}\n", >+ "class MyClass extends Object{\n Number a;\n String b()\n}\n", > getDefaultOptions() > > ); >@@ -314,7 +314,7 @@ > " bar2: function(){}"+ > "}", > "X.js", >- "class ___anonymous10_44 extends Object{\n static String bar;\n static void bar2()\n}\n", >+ "class ___anonymous10_44 extends Object{\n String bar;\n void bar2()\n}\n", > getDefaultOptions() > > ); >@@ -331,7 +331,7 @@ > " bar2: function(){}"+ > "}", > "X.js", >- "class ___anonymous14_48 extends Object{\n static String bar;\n static void bar2()\n}\n", >+ "class ___anonymous14_48 extends Object{\n String bar;\n void bar2()\n}\n", > getDefaultOptions() > > ); >@@ -349,8 +349,8 @@ > " }"+ > "}", > "X.js", >- "class ___anonymous10_52 extends Object{\n static String bar;\n static ___anonymous32_51 bar2;\n}\n"+ >- "class ___anonymous32_51 extends Object{\n static String bar3;\n}\n", >+ "class ___anonymous10_52 extends Object{\n String bar;\n ___anonymous32_51 bar2;\n}\n"+ >+ "class ___anonymous32_51 extends Object{\n String bar3;\n}\n", > getDefaultOptions() > > ); >@@ -367,7 +367,7 @@ > " return \"\";" + > "}", > "X.js", >- "class ___anonymous9_10 extends Object{\n static String foo;\n static String bar()\n}\n", >+ "class ___anonymous9_10 extends Object{\n String foo;\n String bar()\n}\n", > getDefaultOptions() > > ); >@@ -383,8 +383,8 @@ > " bar: \"\""+ > "};", > "X.js", >- "class ___anonymous9_10 extends Object{\n static ___anonymous21_31 foo;\n}\n"+ >- "class ___anonymous21_31 extends Object{\n static String bar;\n}\n", >+ "class ___anonymous9_10 extends Object{\n ___anonymous21_31 foo;\n}\n"+ >+ "class ___anonymous21_31 extends Object{\n String bar;\n}\n", > getDefaultOptions() > > ); >@@ -419,7 +419,7 @@ > "}", > "X.js", > "class foo extends Object{\n ___anonymous37_48 bar;\n foo()\n}\n"+ >- "class ___anonymous37_48 extends Object{\n static String bar2;\n}\n", >+ "class ___anonymous37_48 extends Object{\n String bar2;\n}\n", > getDefaultOptions() > > ); >@@ -438,8 +438,8 @@ > " return \"\";" + > "}", > "X.js", >- "class ___anonymous9_10 extends Object{\n static void foo()\n}\n"+ >- "class ns.foo extends Object{\n String bar;\n String bar2()\n static ns.foo()\n}\n", >+ "class ___anonymous9_10 extends Object{\n void foo()\n}\n"+ >+ "class ns.foo extends Object{\n String bar;\n String bar2()\n ns.foo()\n}\n", > getDefaultOptions() > > ); >@@ -453,7 +453,7 @@ > "ns.foo2 = abc;" + > "", > "X.js", >- "class ___anonymous9_10 extends Object{\n static void foo()\n static void foo2()\n}\n", >+ "class ___anonymous9_10 extends Object{\n void foo()\n void foo2()\n}\n", > getDefaultOptions() > > ); >@@ -466,7 +466,7 @@ > "ns.foo2 = ns.foo;" + > "", > "X.js", >- "class ___anonymous9_10 extends Object{\n static void foo()\n static void foo2()\n}\n", >+ "class ___anonymous9_10 extends Object{\n void foo()\n void foo2()\n}\n", > getDefaultOptions() > > ); >@@ -487,9 +487,9 @@ > " return \"\";" + > "}", > "X.js", >- "class ___anonymous10_20 extends Object{\n static ___anonymous18_19 ns2;\n}\n"+ >- "class ___anonymous18_19 extends Object{\n static void foo()\n}\n"+ >- "class ns1.ns2.foo extends Object{\n String bar;\n String bar2()\n static ns1.ns2.foo()\n}\n", >+ "class ___anonymous10_20 extends Object{\n ___anonymous18_19 ns2;\n}\n"+ >+ "class ___anonymous18_19 extends Object{\n void foo()\n}\n"+ >+ "class ns1.ns2.foo extends Object{\n String bar;\n String bar2()\n ns1.ns2.foo()\n}\n", > getDefaultOptions() > > ); >@@ -511,7 +511,7 @@ > " return { x : \"\", y : \"\", z : \"\" };" + > "};", > "X.js", >- "class ___anonymous10_52 extends Object{\n static String a;\n static String c;\n static String b()\n static ___anonymous101_126 d(x, y, z)\n}\n"+ >+ "class ___anonymous10_52 extends Object{\n String a;\n String c;\n String b()\n ___anonymous101_126 d(x, y, z)\n}\n"+ > "class ___anonymous101_126 extends Object{\n String x;\n String y;\n String z;\n}\n", > getDefaultOptions() > >@@ -525,7 +525,7 @@ > "}" + > "foo.bar = \"\"", > "X.js", >- "class ___anonymous23_24 extends Object{\n static String bar;\n}\n", >+ "class ___anonymous23_24 extends Object{\n String bar;\n}\n", > getDefaultOptions() > > ); >@@ -561,7 +561,7 @@ > " }" + > "};", > "X.js", >- "class ___anonymous32_49 extends Object{\n static String x;\n static String y;\n}\n", >+ "class ___anonymous32_49 extends Object{\n String x;\n String y;\n}\n", > getDefaultOptions() > > ); >#P org.eclipse.wst.jsdt.core >Index: src/org/eclipse/wst/jsdt/core/infer/InferEngine.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/infer/InferEngine.java,v >retrieving revision 1.31 >diff -u -r1.31 InferEngine.java >--- src/org/eclipse/wst/jsdt/core/infer/InferEngine.java 2 Apr 2009 06:45:03 -0000 1.31 >+++ src/org/eclipse/wst/jsdt/core/infer/InferEngine.java 5 May 2009 21:49:14 -0000 >@@ -560,7 +560,7 @@ > * Creates an anonymous type based in the location in the document. This information is used > * to avoid creating duplicates because of the 2-pass nature of this engine. > */ >- private InferredType createAnonymousType( ObjectLiteral objLit, boolean asStatic ) { >+ private InferredType createAnonymousType( ObjectLiteral objLit ) { > > if (objLit.inferredType!=null) > return objLit.inferredType; >@@ -575,9 +575,8 @@ > > anonType.sourceStart = objLit.sourceStart; > anonType.sourceEnd = objLit.sourceEnd; >- anonType.allStatic=asStatic; > >- populateType( anonType, objLit ,asStatic); >+ populateType( anonType, objLit , false); > > return anonType; > } >@@ -944,7 +943,7 @@ > else if ( expression instanceof ObjectLiteral ){ > > //create an annonymous type based on the ObjectLiteral >- InferredType type = createAnonymousType( (ObjectLiteral)expression,true ); >+ InferredType type = createAnonymousType( (ObjectLiteral)expression); > > //set the start and end > type.sourceStart = expression.sourceStart(); >@@ -1090,7 +1089,7 @@ > IExpression expression = returnStatement.getExpression(); > if (expression instanceof IObjectLiteral) > { >- type = createAnonymousType( (ObjectLiteral)expression,false ); >+ type = createAnonymousType( (ObjectLiteral)expression); > > //set the start and end > type.sourceStart = expression.sourceStart(); >@@ -1679,7 +1678,7 @@ > > public boolean visit(IObjectLiteral literal) { > if (this.passNumber==1 && literal.getInferredType()==null) >- createAnonymousType((ObjectLiteral)literal,true); >+ createAnonymousType((ObjectLiteral)literal); > pushContext(); > this.currentContext.currentType=literal.getInferredType(); > return true; >Index: src/org/eclipse/wst/jsdt/internal/compiler/ast/SingleNameReference.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/SingleNameReference.java,v >retrieving revision 1.29 >diff -u -r1.29 SingleNameReference.java >--- src/org/eclipse/wst/jsdt/internal/compiler/ast/SingleNameReference.java 23 Apr 2009 08:28:38 -0000 1.29 >+++ src/org/eclipse/wst/jsdt/internal/compiler/ast/SingleNameReference.java 5 May 2009 21:49:14 -0000 >@@ -429,7 +429,7 @@ > // scope.problemReporter().cannotReferToNonFinalOuterLocal((LocalVariableBinding)variable, this); > // } > TypeBinding fieldType = variable.type; >- if (fieldType.isAnonymousType()) >+ if (fieldType.isAnonymousType() && !fieldType.isObjectLiteralType()) > bits |= Binding.TYPE; > if (useType!=null && !(useType.id==T_null ||useType.id==T_any)) > { >Index: src/org/eclipse/wst/jsdt/internal/compiler/ast/ObjectLiteral.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ObjectLiteral.java,v >retrieving revision 1.13 >diff -u -r1.13 ObjectLiteral.java >--- src/org/eclipse/wst/jsdt/internal/compiler/ast/ObjectLiteral.java 30 Apr 2008 21:32:18 -0000 1.13 >+++ src/org/eclipse/wst/jsdt/internal/compiler/ast/ObjectLiteral.java 5 May 2009 21:49:14 -0000 >@@ -79,6 +79,8 @@ > for (int i = 0; i < this.fields.length; i++) { > this.fields[i].resolveType(scope); > } >+ if(inferredType != null && inferredType.binding != null) >+ return inferredType.binding; > return TypeBinding.ANY; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
thatnitind
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 269055
: 134531