Skip to content
Browse files

[nobug] add namespace tests

  • Loading branch information...
1 parent 72de27f commit 0f93bc139f18ba2e8b6ed101af7ae79d1a15129e nitind committed Aug 19, 2010
View
131 ...sts.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java
@@ -242,6 +242,28 @@ public void test041() {
}
+ public void test041a() {
+ CompilationUnitDeclaration declaration = this.runInferTest(
+ " i= { \n"+
+ "/**\n" +
+ " * @memberOf jsns.MyClass\n" +
+ " * @type jsns.Number\n" +
+ " */\n" +
+ " a: 2 ,\n"+
+ "/**\n" +
+ " * @memberOf jsns.MyClass\n" +
+ " * @type jsns.String\n" +
+ " */\n" +
+ " b: function(){}};" +
+ "\n",
+ "X.js",
+ "class jsns.MyClass extends Object{\n jsns.Number a;\n jsns.String b()\n}\n",
+ getDefaultOptions()
+
+ );
+ }
+
+
public void test042() {
CompilationUnitDeclaration declaration = this.runInferTest(
"/**\n"
@@ -269,6 +291,33 @@ public void test042() {
);
}
+ public void test042a() {
+ CompilationUnitDeclaration declaration = this.runInferTest(
+ "/**\n"
+ + " * @constructor \n"
+ + " * @extends String \n"
+ + " */\n"
+ +"function MyClass(){}"
+
+ +"MyClass.prototype = { \n"+
+ "/**\n" +
+ " * @memberOf MyClass\n" +
+ " * @type jsns.Number\n" +
+ " */\n" +
+ " a: 2 ,\n"+
+ "/**\n" +
+ " * @memberOf MyClass\n" +
+ " * @type jsns.String\n" +
+ " */\n" +
+ " b: function(){}};" +
+ "\n",
+ "X.js",
+ "class MyClass extends String{\n jsns.Number a;\n MyClass()\n jsns.String b()\n}\n",
+ getDefaultOptions()
+
+ );
+ }
+
public void test043() {
CompilationUnitDeclaration declaration = this.runInferTest(
@@ -289,6 +338,25 @@ public void test043() {
);
}
+ public void test043a() {
+ CompilationUnitDeclaration declaration = this.runInferTest(
+ "/**\n"
+ + " * @constructor \n"
+ + " */\n"
+ +"function MyClass(){}"
+ + "/**\n"
+ + " * @memberOf MyClass \n"
+ + " * @param {jsns2.Number} p1\n"
+ + " * @type jsns.String \n"
+ + " */\n"
+ +"function foo(p1){};"
+ +"\n",
+ "X.js",
+ "class MyClass extends Object{\n MyClass()\n jsns.String foo(jsns2.Number p1)\n}\n",
+ getDefaultOptions()
+ );
+ }
+
public void test060() {
CompilationUnitDeclaration declaration = this.runInferTest(
"Shape.prototype.GetArea = Shape_GetArea;"+
@@ -1266,6 +1334,32 @@ public void test108a() {
);
}
+ public void test108d() {
+ CompilationUnitDeclaration declaration = this.runInferTest(
+ "MyTypeInner = {\n"+
+ "/**\n"+
+ " * @memberOf MyTypeInner\n"+
+ " */\n"+
+ "length: 5\n"+
+ "};\n"+
+ "MyType = {\n"+
+ "a : {},\n"+
+ "/**\n"+
+ " * Property events\n"+
+ " * @memberOf MyType\n"+
+ " * @see MyType\n"+
+ " * @type MyTypeInner\n"+
+ " * @since WTP 3.2.2\n"+
+ " */\n"+
+ "events : {},\n"+
+ "b : 5\n"+
+ "};",
+ "X.js",
+ "class MyTypeInner extends Object{\n Number length;\n}\nclass MyType extends Object{\n ___anonymous80_81 a;\n MyTypeInner events;\n Number b;\n}\nclass ___anonymous80_81 extends Object{\n}\n",
+ getDefaultOptions()
+
+ );
+ }
public void test108b() {
CompilationUnitDeclaration declaration = this.runInferTest(
"MyTypeInner = {\n"+
@@ -1323,30 +1417,15 @@ public void test108c() {
);
}
- public void test108d() {
- CompilationUnitDeclaration declaration = this.runInferTest(
- "MyTypeInner = {\n"+
- "/**\n"+
- " * @memberOf MyTypeInner\n"+
- " */\n"+
- "length: 5\n"+
- "};\n"+
- "MyType = {\n"+
- "a : {},\n"+
- "/**\n"+
- " * Property events\n"+
- " * @memberOf MyType\n"+
- " * @see MyType\n"+
- " * @type MyTypeInner\n"+
- " * @since WTP 3.2.2\n"+
- " */\n"+
- "events : {},\n"+
- "b : 5\n"+
- "};",
- "X.js",
- "class MyTypeInner extends Object{\n Number length;\n}\nclass MyType extends Object{\n ___anonymous80_81 a;\n MyTypeInner events;\n Number b;\n}\nclass ___anonymous80_81 extends Object{\n}\n",
- getDefaultOptions()
-
- );
- }
+// public void test109() {
+// CompilationUnitDeclaration declaration = this.runInferTest(
+// "var foo = function () {\n"+
+// "this.length= 5;\n"+
+// "};\n",
+// "X.js",
+// "class foo extends Object{\n Number length;\n}\n",
+// getDefaultOptions()
+//
+// );
+// }
}

0 comments on commit 0f93bc1

Please sign in to comment.
Something went wrong with that request. Please try again.