Permalink
Browse files

Scalaxy/JS: moved code around

  • Loading branch information...
1 parent bf161d8 commit 14b047d36912da4b0f96b438e7e015c13d743d35 @ochafik ochafik committed Feb 23, 2014
Showing with 7,023 additions and 398 deletions.
  1. 0 Experiments/JS/{ → Compiler}/src/main/javascript/experiments.js
  2. 0 Experiments/JS/{ → Compiler}/src/main/javascript/goog.base.js
  3. 0 Experiments/JS/{ → Compiler}/src/main/javascript/goog.deps.js
  4. 0 Experiments/JS/{ → Compiler}/src/main/javascript/mixins.js
  5. 0 Experiments/JS/{ → Compiler}/src/main/javascript/scalaxy.js
  6. 0 Experiments/JS/{ → Compiler}/src/main/javascript/scalaxy.lang.Class.js
  7. 0 Experiments/JS/{ → Compiler}/src/main/javascript/scalaxy.lang.Object.js
  8. 0 Experiments/JS/{ → Compiler}/src/main/javascript/scalaxy.lang.js
  9. 0 Experiments/JS/{ → Compiler}/src/main/javascript/scalaxy.lazy.js
  10. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/ast/JS.scala
  11. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/ast/PosAnnotatedString.scala
  12. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/ast/package.scala
  13. +1 −1 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/compiler/CrossCompiler.scala
  14. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/compiler/CrossCompilerComponent.scala
  15. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/conversion/ASTConverter.scala
  16. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/conversion/ApiMappings.scala
  17. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/conversion/JavaScript.scala
  18. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/conversion/Matchers.scala
  19. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/conversion/QuasiQuoteHacks.scala
  20. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/conversion/ScalaToJSTypeConversions.scala
  21. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/conversion/ScalaToJavaScriptConversion.scala
  22. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/conversion/ScalaToJavaScriptConverter.scala
  23. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/conversion/global.scala
  24. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/conversion/setters.scala
  25. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/runtime/DynamicValue.scala
  26. 0 Experiments/JS/{ → Compiler}/src/main/scala/scalaxy/js/runtime/Union.scala
  27. 0 Experiments/JS/{ → Compiler}/src/test/scala/scalaxy/js/Example.scala
  28. 0 Experiments/JS/{ → Compiler}/src/test/scala/scalaxy/js/Global.scala
  29. 0 Experiments/JS/{ → Compiler}/src/test/scala/scalaxy/js/JavaScriptTest.scala
  30. 0 Experiments/JS/{ → Compiler}/src/test/scala/scalaxy/js/MixinsTest.scala
  31. 0 Experiments/JS/{ → Compiler}/src/test/scala/scalaxy/js/Run.scala
  32. +12 −15 Experiments/JS/{ → Compiler}/src/test/scala/scalaxy/js/ast/JSTest.scala
  33. +39 −0 Experiments/JS/Core/src/main/javascript/experiments.js
  34. +1,607 −0 Experiments/JS/Core/src/main/javascript/goog.base.js
  35. +928 −0 Experiments/JS/Core/src/main/javascript/goog.deps.js
  36. +108 −0 Experiments/JS/Core/src/main/javascript/mixins.js
  37. +35 −0 Experiments/JS/Core/src/main/javascript/scalaxy.js
  38. +173 −0 Experiments/JS/Core/src/main/javascript/scalaxy.lang.Class.js
  39. +33 −0 Experiments/JS/Core/src/main/javascript/scalaxy.lang.Object.js
  40. +4 −0 Experiments/JS/Core/src/main/javascript/scalaxy.lang.js
  41. +60 −0 Experiments/JS/Core/src/main/javascript/scalaxy.lazy.js
  42. 0 Experiments/JS/{ → Core}/src/main/scala/scalaxy/js/package.scala
  43. +11 −0 Experiments/JS/Core/src/main/scala/scalaxy/js/runtime/DynamicValue.scala
  44. +13 −0 Experiments/JS/Core/src/main/scala/scalaxy/js/runtime/Union.scala
  45. +28 −0 Experiments/JS/Core/src/test/scala/scalaxy/js/MixinsTest.scala
  46. +39 −0 Experiments/JS/Generator/src/main/javascript/experiments.js
  47. +1,607 −0 Experiments/JS/Generator/src/main/javascript/goog.base.js
  48. +928 −0 Experiments/JS/Generator/src/main/javascript/goog.deps.js
  49. +108 −0 Experiments/JS/Generator/src/main/javascript/mixins.js
  50. +35 −0 Experiments/JS/Generator/src/main/javascript/scalaxy.js
  51. +173 −0 Experiments/JS/Generator/src/main/javascript/scalaxy.lang.Class.js
  52. +33 −0 Experiments/JS/Generator/src/main/javascript/scalaxy.lang.Object.js
  53. +4 −0 Experiments/JS/Generator/src/main/javascript/scalaxy.lang.js
  54. +60 −0 Experiments/JS/Generator/src/main/javascript/scalaxy.lazy.js
  55. +4 −8 ...s/JS/{src/main/scala/scalaxy/js/Test.scala → Generator/src/main/scala/scalaxy/js/Generator.scala}
  56. +226 −0 Experiments/JS/Generator/src/main/scala/scalaxy/js/ast/JS.scala
  57. +29 −0 Experiments/JS/Generator/src/main/scala/scalaxy/js/ast/PosAnnotatedString.scala
  58. +9 −0 Experiments/JS/Generator/src/main/scala/scalaxy/js/ast/package.scala
  59. +36 −0 Experiments/JS/Generator/src/main/scala/scalaxy/js/externs/ClosureExterns.scala
  60. +11 −0 Experiments/JS/Generator/src/main/scala/scalaxy/js/externs/Externs.scala
  61. +22 −2 Experiments/JS/{ → Generator}/src/main/scala/scalaxy/js/externs/ExternsAnalysis.scala
  62. 0 Experiments/JS/{ → Generator}/src/main/scala/scalaxy/js/externs/JavaScriptExterns.scala
  63. +55 −0 ...riments/JS/Generator/src/main/scala/scalaxy/js/externs/JavaScriptToScalaSignaturesGenerator.scala
  64. 0 Experiments/JS/{ → Generator}/src/main/scala/scalaxy/js/externs/OptionalParam.scala
  65. 0 Experiments/JS/{ → Generator}/src/main/scala/scalaxy/js/externs/ScalaxyClosureUtils.scala
  66. +32 −0 Experiments/JS/Generator/src/main/scala/scalaxy/js/externs/SpecialCases.scala
  67. +386 −0 Experiments/JS/Generator/src/main/scala/scalaxy/js/externs/TreeGenerators.scala
  68. +61 −0 Experiments/JS/Generator/src/test/scala/scalaxy/js/ExternsTest.scala
  69. +50 −0 Experiments/JS/Generator/src/test/scala/scalaxy/js/Run.scala
  70. +63 −0 Experiments/JS/Generator/src/test/scala/scalaxy/js/ast/JSTest.scala
  71. +0 −19 Experiments/JS/src/main/scala/scalaxy/js/externs/ClosureExterns.scala
  72. +0 −101 Experiments/JS/src/main/scala/scalaxy/js/externs/JSToScalaTypeConversions.scala
  73. +0 −24 Experiments/JS/src/main/scala/scalaxy/js/externs/JavaScriptToScalaSignaturesGenerator.scala
  74. +0 −228 Experiments/JS/src/main/scala/scalaxy/js/externs/TreeGenerators.scala
@@ -19,7 +19,7 @@ class CrossCompiler(outputDir: File, settings: Settings, reporter: Reporter)
//, new JSExportComponent(this) if full compilation + export is enabled
}
-object CrossCompiler extends App {
+object CrossCompiler { val args: Array[String] = Array()//extends App {
def findClassPath(c: Class[_]): Option[String] =
Option(c.getProtectionDomain.getCodeSource).map(_.getLocation.getFile)
@@ -17,24 +17,18 @@ class JSTest {
Function(
None,
List(
- Ident("a", pos)),
+ Ident("a")),
Block(
List(
Apply(
Select(
Select(
- Ident("window", pos),
- Ident("console", pos),
- pos),
- Literal("log", pos),
- pos),
+ Ident("window"),
+ Ident("console")),
+ Literal("log")),
List(
Literal(
- "foo\nbar'yo",
- pos)),
- pos)),
- pos),
- pos)).value
+ "foo\nbar'yo"))))))).value
)
}
@@ -45,10 +39,13 @@ class JSTest {
prettyPrint(
JSONObject(
Map(
- "a" -> JSONArray(List(Literal(1, pos), Literal(2, pos)), pos),
- "x" -> Literal(1, pos),
- "y" -> Literal("blah", pos)),
- pos)).value)
+ "a" -> JSONArray(List(Literal(1), Literal(2))),
+ "x" -> Literal(1),
+ "y" -> Literal("blah")
+ )
+ )
+ ).value
+ )
}
// @Test
@@ -0,0 +1,39 @@
+goog.require("scalaxy.lang.Class");
+goog.require("scalaxy.lang.Object");
+
+
+/*
+package test
+class Test(val x: Int) [extends AnyRef] {
+ def blah = println("blah " + x)
+
+ println("Constructing Test with x = " + x)
+}
+*/
+
+if (!test) var test = {};
+
+/**
+ * @constructor
+ * @extends {scalaxy.lang.Object}
+ * @param {number} x
+ */
+test.Test = function(x) {
+ goog.base(this);
+ this.x = x;
+ window.console.log('Constructing Test with x = ' + this.x)
+};
+goog.inherits(test.Test, scalaxy.lang.Object);
+
+scalaxy.lang.Class.defineClass({
+ name: "test.Test",
+ constructor: test.Test,
+ base: scalaxy.lang.Object
+});
+
+/**
+ * @this {!test.Test}
+ */
+test.Test.prototype.blah = function() {
+ window.console.log('blah ' + this.x)
+};
Oops, something went wrong. Retry.

0 comments on commit 14b047d

Please sign in to comment.