Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved deprecated library

svn path=/old-code/; revision=152777
  • Loading branch information...
commit e8e419460ea8c8331c949b7297f21aa77abf2982 1 parent 67e6f28
@migueldeicaza migueldeicaza authored
Showing with 38,116 additions and 0 deletions.
  1. +57 −0 Microsoft.JScript/Assembly/AssemblyInfo.cs
  2. +10 −0 Microsoft.JScript/Assembly/ChangeLog
  3. +152 −0 Microsoft.JScript/ChangeLog
  4. +10 −0 Microsoft.JScript/Makefile
  5. +41 −0 Microsoft.JScript/Microsoft.JScript.Vsa/ChangeLog
  6. +312 −0 Microsoft.JScript/Microsoft.JScript.Vsa/VsaEngine.cs
  7. +204 −0 Microsoft.JScript/Microsoft.JScript.dll.sources
  8. +68 −0 Microsoft.JScript/Microsoft.JScript/ASTList.cs
  9. +86 −0 Microsoft.JScript/Microsoft.JScript/ActivationObject.cs
  10. +53 −0 Microsoft.JScript/Microsoft.JScript/ActiveXObjectConstructor.cs
  11. +39 −0 Microsoft.JScript/Microsoft.JScript/ArgumentsObject.cs
  12. +70 −0 Microsoft.JScript/Microsoft.JScript/ArrayConstructor.cs
  13. +100 −0 Microsoft.JScript/Microsoft.JScript/ArrayLiteral.cs
  14. +112 −0 Microsoft.JScript/Microsoft.JScript/ArrayObject.cs
  15. +488 −0 Microsoft.JScript/Microsoft.JScript/ArrayPrototype.cs
  16. +54 −0 Microsoft.JScript/Microsoft.JScript/ArrayWrapper.cs
  17. +33 −0 Microsoft.JScript/Microsoft.JScript/AssemblyCustomAttributeList.cs
  18. +67 −0 Microsoft.JScript/Microsoft.JScript/BinaryOp.cs
  19. +67 −0 Microsoft.JScript/Microsoft.JScript/Binding.cs
  20. +89 −0 Microsoft.JScript/Microsoft.JScript/BitwiseBinary.cs
  21. +143 −0 Microsoft.JScript/Microsoft.JScript/Block.cs
  22. +48 −0 Microsoft.JScript/Microsoft.JScript/BlockScope.cs
  23. +59 −0 Microsoft.JScript/Microsoft.JScript/BooleanConstructor.cs
  24. +67 −0 Microsoft.JScript/Microsoft.JScript/BooleanObject.cs
  25. +75 −0 Microsoft.JScript/Microsoft.JScript/BooleanPrototype.cs
  26. +44 −0 Microsoft.JScript/Microsoft.JScript/BreakOutOfFinally.cs
  27. +110 −0 Microsoft.JScript/Microsoft.JScript/COMFieldInfo.cs
  28. +48 −0 Microsoft.JScript/Microsoft.JScript/COMMemberInfo.cs
  29. +121 −0 Microsoft.JScript/Microsoft.JScript/COMMethodInfo.cs
  30. +2,688 −0 Microsoft.JScript/Microsoft.JScript/ChangeLog
  31. +53 −0 Microsoft.JScript/Microsoft.JScript/Closure.cs
  32. +74 −0 Microsoft.JScript/Microsoft.JScript/CmdLineError.cs
  33. +61 −0 Microsoft.JScript/Microsoft.JScript/CmdLineException.cs
  34. +68 −0 Microsoft.JScript/Microsoft.JScript/CmdLineOptionParser.cs
  35. +734 −0 Microsoft.JScript/Microsoft.JScript/CodeGenerator.cs
  36. +73 −0 Microsoft.JScript/Microsoft.JScript/Context.cs
  37. +44 −0 Microsoft.JScript/Microsoft.JScript/ContinueOutOfFinally.cs
  38. +508 −0 Microsoft.JScript/Microsoft.JScript/Convert.cs
  39. +748 −0 Microsoft.JScript/Microsoft.JScript/DateConstructor.cs
  40. +41 −0 Microsoft.JScript/Microsoft.JScript/DateObject.cs
  41. +812 −0 Microsoft.JScript/Microsoft.JScript/DatePrototype.cs
  42. +51 −0 Microsoft.JScript/Microsoft.JScript/DebugBreak.cs
  43. +839 −0 Microsoft.JScript/Microsoft.JScript/Decompiler.cs
  44. +42 −0 Microsoft.JScript/Microsoft.JScript/DocumentContext.cs
  45. +54 −0 Microsoft.JScript/Microsoft.JScript/Empty.cs
  46. +101 −0 Microsoft.JScript/Microsoft.JScript/Enum.cs
  47. +55 −0 Microsoft.JScript/Microsoft.JScript/EnumeratorConstructor.cs
  48. +43 −0 Microsoft.JScript/Microsoft.JScript/EnumeratorObject.cs
  49. +68 −0 Microsoft.JScript/Microsoft.JScript/EnumeratorPrototype.cs
  50. +210 −0 Microsoft.JScript/Microsoft.JScript/Equality.cs
  51. +132 −0 Microsoft.JScript/Microsoft.JScript/ErrorConstructor.cs
  52. +55 −0 Microsoft.JScript/Microsoft.JScript/ErrorObject.cs
  53. +53 −0 Microsoft.JScript/Microsoft.JScript/ErrorPrototype.cs
  54. +65 −0 Microsoft.JScript/Microsoft.JScript/Eval.cs
  55. +40 −0 Microsoft.JScript/Microsoft.JScript/EvalErrorObject.cs
  56. +40 −0 Microsoft.JScript/Microsoft.JScript/Expando.cs
  57. +40 −0 Microsoft.JScript/Microsoft.JScript/FieldAccessor.cs
  58. +170 −0 Microsoft.JScript/Microsoft.JScript/ForIn.cs
  59. +140 −0 Microsoft.JScript/Microsoft.JScript/FormalParameterList.cs
  60. +58 −0 Microsoft.JScript/Microsoft.JScript/FunctionConstructor.cs
  61. +279 −0 Microsoft.JScript/Microsoft.JScript/FunctionDeclaration.cs
  62. +261 −0 Microsoft.JScript/Microsoft.JScript/FunctionExpression.cs
  63. +133 −0 Microsoft.JScript/Microsoft.JScript/FunctionObject.cs
  64. +67 −0 Microsoft.JScript/Microsoft.JScript/FunctionPrototype.cs
  65. +42 −0 Microsoft.JScript/Microsoft.JScript/FunctionWrapper.cs
  66. +650 −0 Microsoft.JScript/Microsoft.JScript/GlobalObject.cs
  67. +114 −0 Microsoft.JScript/Microsoft.JScript/GlobalScope.cs
  68. +51 −0 Microsoft.JScript/Microsoft.JScript/Globals.cs
  69. +43 −0 Microsoft.JScript/Microsoft.JScript/IActivationObject.cs
  70. +41 −0 Microsoft.JScript/Microsoft.JScript/IAuthorServices.cs
  71. +41 −0 Microsoft.JScript/Microsoft.JScript/IColorizeText.cs
  72. +62 −0 Microsoft.JScript/Microsoft.JScript/IDebugConvert.cs
  73. +40 −0 Microsoft.JScript/Microsoft.JScript/IDebugScriptScope.cs
  74. +40 −0 Microsoft.JScript/Microsoft.JScript/IDebugType.cs
  75. +42 −0 Microsoft.JScript/Microsoft.JScript/IDebugVsaScriptCodeItem.cs
  76. +44 −0 Microsoft.JScript/Microsoft.JScript/IDebuggerObject.cs
  77. +40 −0 Microsoft.JScript/Microsoft.JScript/IDefineEvent.cs
  78. +56 −0 Microsoft.JScript/Microsoft.JScript/IEngine2.cs
  79. +40 −0 Microsoft.JScript/Microsoft.JScript/IErrorHandler.cs
  80. +39 −0 Microsoft.JScript/Microsoft.JScript/IMethodsCompletionInfo.cs
  81. +39 −0 Microsoft.JScript/Microsoft.JScript/INeedEngine.cs
  82. +41 −0 Microsoft.JScript/Microsoft.JScript/IObjectCompletionInfo.cs
  83. +40 −0 Microsoft.JScript/Microsoft.JScript/IParseText.cs
  84. +108 −0 Microsoft.JScript/Microsoft.JScript/IRedirectOutput.cs
  85. +41 −0 Microsoft.JScript/Microsoft.JScript/ISite2.cs
  86. +42 −0 Microsoft.JScript/Microsoft.JScript/ITokenColorInfo.cs
  87. +41 −0 Microsoft.JScript/Microsoft.JScript/ITokenEnumerator.cs
  88. +41 −0 Microsoft.JScript/Microsoft.JScript/IVsaFullErrorInfo.cs
  89. +44 −0 Microsoft.JScript/Microsoft.JScript/IVsaScriptCodeItem.cs
  90. +62 −0 Microsoft.JScript/Microsoft.JScript/IVsaScriptScope.cs
  91. +36 −0 Microsoft.JScript/Microsoft.JScript/IWrappedMember.cs
  92. +503 −0 Microsoft.JScript/Microsoft.JScript/IdentificationTable.cs
  93. +69 −0 Microsoft.JScript/Microsoft.JScript/Import.cs
  94. +66 −0 Microsoft.JScript/Microsoft.JScript/In.cs
  95. +85 −0 Microsoft.JScript/Microsoft.JScript/InstanceOf.cs
  96. +192 −0 Microsoft.JScript/Microsoft.JScript/JSBuiltIn.cs
  97. +115 −0 Microsoft.JScript/Microsoft.JScript/JSConstructor.cs
  98. +277 −0 Microsoft.JScript/Microsoft.JScript/JSError.cs
  99. +80 −0 Microsoft.JScript/Microsoft.JScript/JSField.cs
  100. +130 −0 Microsoft.JScript/Microsoft.JScript/JSFieldInfo.cs
  101. +65 −0 Microsoft.JScript/Microsoft.JScript/JSFunctionAttribute.cs
  102. +47 −0 Microsoft.JScript/Microsoft.JScript/JSFunctionAttributeEnum.cs
  103. +58 −0 Microsoft.JScript/Microsoft.JScript/JSLocalField.cs
  104. +91 −0 Microsoft.JScript/Microsoft.JScript/JSMethod.cs
  105. +148 −0 Microsoft.JScript/Microsoft.JScript/JSMethodInfo.cs
  106. +151 −0 Microsoft.JScript/Microsoft.JScript/JSObject.cs
  107. +75 −0 Microsoft.JScript/Microsoft.JScript/JSParser.cs
  108. +134 −0 Microsoft.JScript/Microsoft.JScript/JSPropertyInfo.cs
  109. +39 −0 Microsoft.JScript/Microsoft.JScript/JSPrototypeObject.cs
  110. +118 −0 Microsoft.JScript/Microsoft.JScript/JSScanner.cs
  111. +188 −0 Microsoft.JScript/Microsoft.JScript/JSToken.cs
  112. +58 −0 Microsoft.JScript/Microsoft.JScript/JSVariableField.cs
  113. +368 −0 Microsoft.JScript/Microsoft.JScript/JScriptCodeCompiler.cs
  114. +1,150 −0 Microsoft.JScript/Microsoft.JScript/JScriptCodeGenerator.cs
  115. +80 −0 Microsoft.JScript/Microsoft.JScript/JScriptCodeProvider.cs
  116. +180 −0 Microsoft.JScript/Microsoft.JScript/JScriptException.cs
  117. +669 −0 Microsoft.JScript/Microsoft.JScript/LateBinding.cs
  118. +53 −0 Microsoft.JScript/Microsoft.JScript/LenientArrayPrototype.cs
  119. +47 −0 Microsoft.JScript/Microsoft.JScript/LenientBooleanPrototype.cs
  120. +40 −0 Microsoft.JScript/Microsoft.JScript/LenientDateConstructor.cs
  121. +84 −0 Microsoft.JScript/Microsoft.JScript/LenientDatePrototype.cs
  122. +41 −0 Microsoft.JScript/Microsoft.JScript/LenientEnumeratorPrototype.cs
  123. +39 −0 Microsoft.JScript/Microsoft.JScript/LenientErrorPrototype.cs
  124. +40 −0 Microsoft.JScript/Microsoft.JScript/LenientFunctionPrototype.cs
  125. +169 −0 Microsoft.JScript/Microsoft.JScript/LenientGlobalObject.cs
  126. +63 −0 Microsoft.JScript/Microsoft.JScript/LenientMathObject.cs
  127. +45 −0 Microsoft.JScript/Microsoft.JScript/LenientNumberPrototype.cs
  128. +43 −0 Microsoft.JScript/Microsoft.JScript/LenientObjectPrototype.cs
  129. +43 −0 Microsoft.JScript/Microsoft.JScript/LenientRegExpPrototype.cs
  130. +35 −0 Microsoft.JScript/Microsoft.JScript/LenientStringConstructor.cs
  131. +69 −0 Microsoft.JScript/Microsoft.JScript/LenientStringPrototype.cs
  132. +42 −0 Microsoft.JScript/Microsoft.JScript/LenientVBArrayPrototype.cs
  133. +426 −0 Microsoft.JScript/Microsoft.JScript/Literal.cs
  134. +196 −0 Microsoft.JScript/Microsoft.JScript/MathObject.cs
  135. +41 −0 Microsoft.JScript/Microsoft.JScript/MemberInfoInitializer.cs
  136. +212 −0 Microsoft.JScript/Microsoft.JScript/MemberInfoList.cs
  137. +40 −0 Microsoft.JScript/Microsoft.JScript/MethodInvoker.cs
  138. +35 −0 Microsoft.JScript/Microsoft.JScript/Missing.cs
  139. +87 −0 Microsoft.JScript/Microsoft.JScript/Namespace.cs
  140. +52 −0 Microsoft.JScript/Microsoft.JScript/NotRecommendedAttribute.cs
  141. +75 −0 Microsoft.JScript/Microsoft.JScript/NumberConstructor.cs
  142. +60 −0 Microsoft.JScript/Microsoft.JScript/NumberObject.cs
  143. +174 −0 Microsoft.JScript/Microsoft.JScript/NumberPrototype.cs
  144. +86 −0 Microsoft.JScript/Microsoft.JScript/NumericBinary.cs
  145. +82 −0 Microsoft.JScript/Microsoft.JScript/NumericUnary.cs
  146. +79 −0 Microsoft.JScript/Microsoft.JScript/ObjectConstructor.cs
  147. +107 −0 Microsoft.JScript/Microsoft.JScript/ObjectPrototype.cs
  148. +59 −0 Microsoft.JScript/Microsoft.JScript/Package.cs
  149. +1,518 −0 Microsoft.JScript/Microsoft.JScript/Parser.cs
  150. +76 −0 Microsoft.JScript/Microsoft.JScript/Plus.cs
  151. +162 −0 Microsoft.JScript/Microsoft.JScript/PostOrPrefixOperator.cs
  152. +64 −0 Microsoft.JScript/Microsoft.JScript/Print.cs
  153. +124 −0 Microsoft.JScript/Microsoft.JScript/README
  154. +41 −0 Microsoft.JScript/Microsoft.JScript/RangeErrorObject.cs
  155. +44 −0 Microsoft.JScript/Microsoft.JScript/ReferenceAttribute.cs
  156. +40 −0 Microsoft.JScript/Microsoft.JScript/ReferenceErrorObject.cs
  157. +205 −0 Microsoft.JScript/Microsoft.JScript/RegExpConstructor.cs
  158. +34 −0 Microsoft.JScript/Microsoft.JScript/RegExpMatch.cs
  159. +117 −0 Microsoft.JScript/Microsoft.JScript/RegExpObject.cs
  160. +122 −0 Microsoft.JScript/Microsoft.JScript/RegExpPrototype.cs
  161. +157 −0 Microsoft.JScript/Microsoft.JScript/Relational.cs
  162. +54 −0 Microsoft.JScript/Microsoft.JScript/ResInfo.cs
  163. +40 −0 Microsoft.JScript/Microsoft.JScript/ReturnOutOfFinally.cs
  164. +169 −0 Microsoft.JScript/Microsoft.JScript/ScriptBlock.cs
  165. +200 −0 Microsoft.JScript/Microsoft.JScript/ScriptFunction.cs
  166. +267 −0 Microsoft.JScript/Microsoft.JScript/ScriptObject.cs
  167. +65 −0 Microsoft.JScript/Microsoft.JScript/ScriptStream.cs
  168. +425 −0 Microsoft.JScript/Microsoft.JScript/SemanticAnalizer.cs
  169. +89 −0 Microsoft.JScript/Microsoft.JScript/SimpleHashtable.cs
  170. +42 −0 Microsoft.JScript/Microsoft.JScript/SourceState.cs
  171. +102 −0 Microsoft.JScript/Microsoft.JScript/StackFrame.cs
  172. +919 −0 Microsoft.JScript/Microsoft.JScript/Statement.cs
  173. +124 −0 Microsoft.JScript/Microsoft.JScript/StrictEquality.cs
  174. +81 −0 Microsoft.JScript/Microsoft.JScript/StringConstructor.cs
  175. +78 −0 Microsoft.JScript/Microsoft.JScript/StringLiteral.cs
  176. +76 −0 Microsoft.JScript/Microsoft.JScript/StringObject.cs
  177. +590 −0 Microsoft.JScript/Microsoft.JScript/StringPrototype.cs
  178. +34 −0 Microsoft.JScript/Microsoft.JScript/SuperTypeMembersSorter.cs
  179. +40 −0 Microsoft.JScript/Microsoft.JScript/SyntaxErrorObject.cs
  180. +50 −0 Microsoft.JScript/Microsoft.JScript/TODO
  181. +63 −0 Microsoft.JScript/Microsoft.JScript/Throw.cs
  182. +487 −0 Microsoft.JScript/Microsoft.JScript/Token.cs
  183. +47 −0 Microsoft.JScript/Microsoft.JScript/TokenColor.cs
  184. +1,513 −0 Microsoft.JScript/Microsoft.JScript/TokenStream.cs
  185. +138 −0 Microsoft.JScript/Microsoft.JScript/Try.cs
  186. +40 −0 Microsoft.JScript/Microsoft.JScript/TypeErrorObject.cs
  187. +82 −0 Microsoft.JScript/Microsoft.JScript/TypeManager.cs
  188. +90 −0 Microsoft.JScript/Microsoft.JScript/TypeOf.cs
  189. +49 −0 Microsoft.JScript/Microsoft.JScript/TypeReflector.cs
  190. +139 −0 Microsoft.JScript/Microsoft.JScript/TypedArray.cs
  191. +40 −0 Microsoft.JScript/Microsoft.JScript/URIErrorObject.cs
  192. +43 −0 Microsoft.JScript/Microsoft.JScript/UnaryOp.cs
  193. +48 −0 Microsoft.JScript/Microsoft.JScript/VBArrayConstructor.cs
  194. +42 −0 Microsoft.JScript/Microsoft.JScript/VBArrayObject.cs
  195. +72 −0 Microsoft.JScript/Microsoft.JScript/VBArrayPrototype.cs
  196. +48 −0 Microsoft.JScript/Microsoft.JScript/VSAITEMTYPE2.cs
  197. +148 −0 Microsoft.JScript/Microsoft.JScript/VariableDeclaration.cs
  198. +97 −0 Microsoft.JScript/Microsoft.JScript/VariableStatement.cs
  199. +47 −0 Microsoft.JScript/Microsoft.JScript/VersionableAttribute.cs
  200. +92 −0 Microsoft.JScript/Microsoft.JScript/VsaCodeItem.cs
  201. +77 −0 Microsoft.JScript/Microsoft.JScript/VsaGlobalItem.cs
  202. +120 −0 Microsoft.JScript/Microsoft.JScript/VsaItem.cs
  203. +159 −0 Microsoft.JScript/Microsoft.JScript/VsaItems.cs
  204. +62 −0 Microsoft.JScript/Microsoft.JScript/VsaReferenceItem.cs
  205. +107 −0 Microsoft.JScript/Microsoft.JScript/VsaScriptScope.cs
  206. +101 −0 Microsoft.JScript/Microsoft.JScript/With.cs
  207. +238 −0 Microsoft.JScript/Microsoft.JScript/ast.cs
  208. +2,556 −0 Microsoft.JScript/Microsoft.JScript/expression.cs
  209. +1,250 −0 Microsoft.JScript/Microsoft.JScript/jscript-lexer-parser.g
  210. +2 −0  Microsoft.JScript/Microsoft.JScript_test.dll.sources
  211. +647 −0 Microsoft.JScript/Microsoft.Vsa/BaseVsaEngine.cs
  212. +28 −0 Microsoft.JScript/Microsoft.Vsa/ChangeLog
  213. +16 −0 Microsoft.JScript/Test/Microsoft.JScript/ChangeLog
  214. +186 −0 Microsoft.JScript/Test/Microsoft.JScript/VsaItemTest.cs
  215. +256 −0 Microsoft.JScript/Test/Microsoft.JScript/VsaItemsTest.cs
  216. +171 −0 Microsoft.JScript/Test/Mozilla/ChangeLog
  217. +283 −0 Microsoft.JScript/Test/Mozilla/README
  218. +131 −0 Microsoft.JScript/Test/Mozilla/ecma/Array/15.4-1.js
  219. +112 −0 Microsoft.JScript/Test/Mozilla/ecma/Array/15.4-2.js
  220. +109 −0 Microsoft.JScript/Test/Mozilla/ecma/Array/15.4.1.1.js
  221. +163 −0 Microsoft.JScript/Test/Mozilla/ecma/Array/15.4.1.2.js
  222. +82 −0 Microsoft.JScript/Test/Mozilla/ecma/Array/15.4.1.3.js
  223. +130 −0 Microsoft.JScript/Test/Mozilla/ecma/Array/15.4.1.js
  224. +110 −0 Microsoft.JScript/Test/Mozilla/ecma/Array/15.4.2.1-1.js
  225. +99 −0 Microsoft.JScript/Test/Mozilla/ecma/Array/15.4.2.1-2.js
Sorry, we could not display the entire diff because too many files (1,436) changed.
View
57 Microsoft.JScript/Assembly/AssemblyInfo.cs
@@ -0,0 +1,57 @@
+//
+// AssemblyInfo.cs
+//
+// Author:
+// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
+//
+// (C) 2003 Ximian, Inc. http://www.ximian.com
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Resources;
+
+[assembly: AssemblyVersion (Consts.VsVersion)]
+#if (NET_2_0)
+// [assembly: CLSCompliant (true)]
+#else
+[assembly: SatelliteContractVersion (Consts.VsVersion)]
+#endif
+
+#if (ONLY_1_1)
+ [assembly: TypeLibVersion(7, 1)]
+#endif
+
+[assembly: AssemblyTitle ("Microsoft.JScript")]
+[assembly: AssemblyDescription("Microsoft.JScript.dll")]
+[assembly: AssemblyCompany("MONO development team")]
+[assembly: AssemblyCopyright("(c) 2003 Various Authors")]
+
+[assembly: NeutralResourcesLanguage("en-US")]
+[assembly: AllowPartiallyTrustedCallers()]
+
+[assembly: AssemblyDelaySign(true)]
+[assembly: AssemblyKeyFile("../msfinal.pub")]
View
10 Microsoft.JScript/Assembly/ChangeLog
@@ -0,0 +1,10 @@
+2005-05-18 Marek Safar <marek.safar@seznam.cz>
+
+ * AssemblyInfo.cs: Fixed attributes.
+
+2004-04-28 Sebastien Pouliot <sebastien@ximian.com>
+
+ * AssemblyInfo.cs: Added
+ * ChangeLog: Added
+ * Locale.cs: Added
+ * TODOAttribute.cs: Added
View
152 Microsoft.JScript/ChangeLog
@@ -0,0 +1,152 @@
+2006-07-26 César Octavio López Natarén <cesar.nataren@gmail.com>
+
+ * Microsoft.JScript.dll.sources: Added JScriptCodeCompiler.cs from
+ Akiramei (mei@work.email.ne.jp) to the build.
+
+2006-01-08 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * Makefile: No longer reference the C# compiler for namespace
+ lookup.
+
+2005-10-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+ * SemanticAnalizer.cs, Import.cs: Update calls to the
+ latest changes in namespace.cs. Keep the old calls for
+ 2.0 profile, and update them as soon as these changes are
+ merged to gmcs.
+
+2005-09-15 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile (COMPILER): New. Points to mcs.exe or gmcs.exe
+ depending on the profile.
+ (LIB_MCS_FLAGS): Pick the profile dependent compiler.
+
+2005-09-14 Ritvik Mayank <mritvik@novell.com>
+
+ * Makefile : Added mcs.exe path
+
+2005-08-08 Florian Gross <flgr@ccan.de>
+
+ * Imported Test/Mozilla
+
+2005-05-18 Marek Safar <marek.safar@seznam.cz>
+
+ * Microsoft.JScript.dll.sources: Added JScriptCodeGenerator.cs
+
+2005-05-07 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * COMFieldInfo.cs, COMMethodInfo.cs, JSMethod.cs: added to the
+ build.
+
+2005-05-06 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * Add ArgumentsObject.cs to the build is used on code generated
+ when the implicit arguments object is used inside a method.
+
+2005-05-03 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * Microsoft.JScript.dll.sources: IWrappedMember.cs,
+ IVsaScriptCodeItem.cs, IDebugType.cs, IDefineEvent.cs,
+ IEngine2.cs, IMethodsCompletionInfo.cs, INeedEngine.cs,
+ IObjectCompletionInfo.cs, ISite2.cs, MemberInfoInitializer.cs, VSAITEMTYPE2.cs
+ added to the build.
+
+2005-05-02 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * Microsoft.JScript.dll.sources: COMMemberInfo.cs,
+ IAuthorServices.cs, IColorizeText.cs, IDebugConvert.cs,
+ IDebuggerObject.cs, IDebugScriptScope.cs, IErrorHandler.cs,
+ IParseText.cs, ITokenColorInfo.cs, ITokenEnumerator.cs,
+ IVsaFullErrorInfo.cs, SourceState.cs, TokenColor.cs added to the
+ build. These are missing interfaces for COM interop.
+
+2005-02-05 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * Microsoft.JScript.dll.sources: Nuke SymbolTable.cs
+
+2004-12-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
+
+ * Microsoft.JScript.dll.sources: add JSPropertyInfo.cs
+
+2004-10-11 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
+
+ * Microsoft.JScript.dll.sources: add TypeMananger.cs
+
+2004-09-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
+
+ * Antlr.Runtime/[antlr, antlr.collections, antlr.collections.impl,
+ antlr.debug, antlr.debug.misc]: Good bye antlr.
+ * Microsoft.JScript.dll.sources: dropped antlr dependency.
+
+2004-08-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
+
+ * Microsoft.JScript.dll.sources: added In.cs, Token.cs,
+ TokenStream.cs and Parser.cs to the build. Don't build
+ JScriptLexer.cs and JScriptParser.cs
+
+2004-04-28 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Microsoft.JScript.dll.sources: Added Assembly/AssemblyInfo.cs and
+ Locale.cs to the build.
+
+2004-01-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
+
+ * Microsoft.JScript.dll.sources: added VsaScriptScope to the build.
+
+2003-11-10 <cesar@ciencias.unam.mx>
+
+ * Microsoft.JScript.dll.sources: don't build Visitor.cs.
+
+2003-11-03 <cesar@ciencias.unam.mx>
+
+ * Microsoft.JScript.dll.sources: Added IdentificationTable.cs,
+ SemanticAnalizer.cs and SymbolTable.cs to the build.
+
+2003-09-29 <cesar@ciencias.unam.mx>
+
+ * Makefile: Set TEST_MCS_FLAGS.
+
+ * Microsoft.JScript_test.dll.sources: deleted the building of my
+ local test BaseVsaEngineTest.
+
+ * Added Microsoft.JScript_test.dll.sources
+
+ * Makefile: allow test build.
+
+ * Microsoft.JScript.dll.sources: Added VsaItem.cs, VsaItems.cs,
+ VsaGlobalItem.cs, VsaReferenceItem.cs , VsaCodeItem.cs to the build.
+
+2003-09-24 <cesar@ciencias.unam.mx>
+
+ * Microsoft.JScript/: Deleted VsaEngine.cs and BaseVsaEngine.cs
+
+ * Microsoft.JScript.dll.sources: Changed the namespaces for VsaEngine and BaseVsaEngine.
+
+
+2003-07-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
+
+ * Added the new files to the build.
+
+2003-06-09 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
+ * Added FormalParameterList, Statement, VariableDeclaration,
+ VariableStatement and Visitor files to the unix.args.
+
+2003-04-21 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
+
+ * Added Antlr.Runtime, it contains the files needed for compiling
+ the files generated by antlr.
+
+ * Added Antlr.Runtime/antlr, Antlr.Runtime/antlr.collections,
+ Antlr.Runtime/antlr.collections.impl, Antlr.Runtime/antlr.debug,
+ Antlr.Runtime/antlr.debug.misc.
+
+ * makefile.gnu: Added some more references to the compilation.
+ * unix.args: Erased some newlines and tabs that were confusing
+ mcs.
+ * ScriptObject.cs: Commented "public Object this [params ...]" temp.
+
+2003-04-20 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
+
+ * ChangeLog: Added this file.
+ * Added makefile.gnu and unix.args.
+
View
10 Microsoft.JScript/Makefile
@@ -0,0 +1,10 @@
+thisdir = class/Microsoft.JScript
+SUBDIRS =
+include ../../build/rules.make
+
+LIBRARY = Microsoft.JScript.dll
+LIB_MCS_FLAGS = -r:System.dll -r:Microsoft.Vsa.dll -debug+
+
+TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
+
+include ../../build/library.make
View
41 Microsoft.JScript/Microsoft.JScript.Vsa/ChangeLog
@@ -0,0 +1,41 @@
+2006-01-11 Evan Briones <evan@evanbriones.com>
+
+ * VsaEngine.cs: Fixed out compiler flag
+
+2005-10-11 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * VsaEngine.cs: Parse all the files.
+
+2005-09-13 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * VsaEngine.cs: Override method Compile and SetOption from BaseVsaEngine,
+
+2005-08-31 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * VsaEngine.cs: Added method GetParser, eval needs it.
+
+2005-07-09 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * VsaEngine.cs: Return proper constructors.
+
+2005-07-05 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * VsaEngine.cs: Implemented GetOriginalRegExpConstructor.
+
+2005-03-29 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * VsaEngine.cs: Return top of the stack casted to a ScriptObject.
+
+2004-01-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
+
+ * VsaEngine.cs: added an Stack, a VsaScriptScope, do not throw exceptions for:
+ CreateEngineAndgetGlobalScope, GetGlobalScope, InitVsaEngine,
+ PopScriptObject, PushScriptObject, the reason is for being able to
+ run the tests at jtests. Be aware that this must get implemented yet.
+
+2003-09-29 <cesar@ciencias.unam.mx>
+
+ * VsaEngine.cs: uncommented inheritance from BaseVsaEngine (thanks
+ goes to jackson). Added constructor, added InitOptions,
+ GetSpecificOption, SetSpecificOption.
+
View
312 Microsoft.JScript/Microsoft.JScript.Vsa/VsaEngine.cs
@@ -0,0 +1,312 @@
+//
+// VsaEngine.cs:
+//
+// Author: Cesar Octavio Lopez Nataren
+//
+// (C) Cesar Octavio Lopez Nataren, <cesar@ciencias.unam.mx>
+// Copyright (C) 2005 Novell, Inc (http://novell.com)
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using Microsoft.Vsa;
+using System.Collections;
+
+namespace Microsoft.JScript.Vsa {
+
+ public class VsaEngine : BaseVsaEngine, IRedirectOutput {
+
+ static private Hashtable options;
+ internal VsaScriptScope global_scope;
+ internal Stack globals;
+
+ public VsaEngine ()
+ : this (true)
+ {
+ InitOptions ();
+ }
+
+ public VsaEngine (bool b)
+ : base ("JScript", "0.0.1", true)
+ {
+ globals = new Stack (4);
+ }
+
+ public virtual IVsaEngine Clone (AppDomain appDom)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual bool CompileEmpty ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override bool Compile ()
+ {
+ ArrayList code_items = new ArrayList ();
+
+ foreach (IVsaItem item in Items) {
+ if (item is IVsaCodeItem)
+ code_items.Add (item);
+ else if (item is IVsaReferenceItem)
+ continue;
+ else
+ throw new Exception ("FIXME: VsaItemType.AppGlobal");
+ }
+ Parser parser = new Parser (code_items);
+ ScriptBlock [] blocks = parser.ParseAll ();
+ if (blocks != null) {
+ SemanticAnalyser.Run (blocks, (Assembly []) GetOption ("assemblies"));
+ object outfile = GetOption ("out");
+
+ if (outfile == null)
+ CodeGenerator.Run ((string) GetOption ("first_source"), blocks);
+ else
+ CodeGenerator.Run ((string) outfile, blocks);
+
+ Console.WriteLine ("Compilation succeeded");
+ }
+ return false;
+ }
+
+ public virtual void ConectEvents ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static GlobalScope CreateEngineAndGetGlobalScope (bool fast, string [] assembly_names)
+ {
+ int i, n;
+ GlobalScope scope;
+
+ VsaEngine engine = new VsaEngine (fast);
+ engine.InitVsaEngine ("JScript.Vsa.VsaEngine://Microsoft.JScript.VsaEngine.Vsa",
+ new DefaultVsaSite ());
+ n = assembly_names.Length;
+
+ for (i = 0; i < n; i++) {
+ string assembly_name = assembly_names [i];
+ VsaReferenceItem r = (VsaReferenceItem) engine.Items.CreateItem (assembly_name,
+ VsaItemType.Reference,
+ VsaItemFlag.None);
+ r.AssemblyName = assembly_name;
+ }
+ scope = (GlobalScope) engine.GetGlobalScope ().GetObject ();
+ return scope;
+ }
+
+ public static GlobalScope CreateEngineAndGetGlobalScopeWithType (bool b, string [] assemblyNames,
+ RuntimeTypeHandle callTypeHandle)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static VsaEngine CreateEngine ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static VsaEngine CreateEngineWithType (RuntimeTypeHandle callTypeHandle)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual void DisconnectEvents ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual Assembly GetAssembly ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual IVsaScriptScope GetGlobalScope ()
+ {
+ if (global_scope == null) {
+ global_scope = new VsaScriptScope (this, "Global", null);
+ }
+
+ return global_scope;
+ }
+
+ public virtual GlobalScope GetMainScope ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual Module GetModule ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ArrayConstructor GetOriginalArrayConstructor ()
+ {
+ return ArrayConstructor.Ctr;
+ }
+
+ public ObjectConstructor GetOriginalObjectConstructor ()
+ {
+ return ObjectConstructor.Ctr;
+ }
+
+ public RegExpConstructor GetOriginalRegExpConstructor ()
+ {
+ return RegExpConstructor.Ctr;
+ }
+
+ public void InitVsaEngine (string moniker, IVsaSite site)
+ {
+ RootMoniker = moniker;
+ Site = site;
+ InitNewCalled = true;
+ RootNamespace = "JScript.DefaultNamespace";
+ IsDirty = true;
+ compiled = false;
+ }
+
+ public virtual void Interrupt ()
+ {
+ throw new NotImplementedException ();
+ }
+
+
+ public override bool IsValidIdentifier (string ident)
+ {
+ throw new NotImplementedException ();
+ }
+
+
+ public LenientGlobalObject LenientGlobalObject {
+ get { throw new NotImplementedException (); }
+ }
+
+ public ScriptObject PopScriptObject ()
+ {
+ ScriptObject script_obj = null;
+
+ try {
+ script_obj = (ScriptObject) globals.Pop ();
+ } catch (NullReferenceException) {
+ }
+ return script_obj;
+ }
+
+ public void PushScriptObject (ScriptObject obj)
+ {
+ try {
+ globals.Push (obj);
+ } catch (NullReferenceException) {
+ }
+ }
+
+ public virtual void RegisterEventSource (string name)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override void Reset ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual void Restart ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual void RunEmpty ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual void Run (AppDomain appDom)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ScriptObject ScriptObjectStackTop ()
+ {
+ return (ScriptObject) globals.Peek ();
+ }
+
+ public virtual void SetOutputStream (IMessageReceiver output)
+ {
+ throw new NotImplementedException ();
+ }
+
+ internal static void InitOptions ()
+ {
+ options = new Hashtable ();
+
+ options.Add ("AlwaysGenerateIL", false);
+ options.Add ("CLSCompliant", false);
+ options.Add ("DebugDirectory", "");
+ options.Add ("Defines", new Hashtable ());
+ options.Add ("Fast", true);
+ // FIXME: "ManagedResources"
+ options.Add ("Print", true);
+ options.Add ("UseContextRelativeStatics", false);
+ options.Add ("VersionSafe", false);
+ options.Add ("WarnAsError", false);
+ options.Add ("WarningLevel", 1);
+ options.Add ("Win32Resource", "");
+ }
+
+ protected override object GetSpecificOption (string name)
+ {
+ object opt;
+
+ try {
+ opt = options [name];
+ } catch (NotSupportedException) {
+ throw new VsaException (VsaError.OptionNotSupported);
+ }
+ return opt;
+ }
+
+ public override void SetOption (string name, object value)
+ {
+ SetSpecificOption (name, value);
+ }
+
+ protected override void SetSpecificOption (string name, object val)
+ {
+ try {
+ options [name] = val;
+ } catch (NotSupportedException) {
+ throw new VsaException (VsaError.OptionNotSupported);
+ }
+ }
+
+ internal Parser GetParser ()
+ {
+ return new Parser ();
+ }
+ }
+
+ class DefaultVsaSite : BaseVsaSite {
+ }
+}
View
204 Microsoft.JScript/Microsoft.JScript.dll.sources
@@ -0,0 +1,204 @@
+Assembly/AssemblyInfo.cs
+../../build/common/Consts.cs
+../../build/common/Locale.cs
+Microsoft.JScript/ast.cs
+Microsoft.JScript/ASTList.cs
+Microsoft.JScript/ActivationObject.cs
+Microsoft.JScript/ActiveXObjectConstructor.cs
+Microsoft.JScript/ArgumentsObject.cs
+Microsoft.JScript/ArrayConstructor.cs
+Microsoft.JScript/ArrayLiteral.cs
+Microsoft.JScript/ArrayObject.cs
+Microsoft.JScript/ArrayPrototype.cs
+Microsoft.JScript/ArrayWrapper.cs
+Microsoft.JScript/AssemblyCustomAttributeList.cs
+Microsoft.Vsa/BaseVsaEngine.cs
+Microsoft.JScript/BinaryOp.cs
+Microsoft.JScript/Binding.cs
+Microsoft.JScript/BitwiseBinary.cs
+Microsoft.JScript/Block.cs
+Microsoft.JScript/BlockScope.cs
+Microsoft.JScript/BooleanConstructor.cs
+Microsoft.JScript/BooleanObject.cs
+Microsoft.JScript/BooleanPrototype.cs
+Microsoft.JScript/BreakOutOfFinally.cs
+Microsoft.JScript/Closure.cs
+Microsoft.JScript/CmdLineException.cs
+Microsoft.JScript/CmdLineError.cs
+Microsoft.JScript/CmdLineOptionParser.cs
+Microsoft.JScript/CodeGenerator.cs
+Microsoft.JScript/COMFieldInfo.cs
+Microsoft.JScript/COMMethodInfo.cs
+Microsoft.JScript/COMMemberInfo.cs
+Microsoft.JScript/Context.cs
+Microsoft.JScript/ContinueOutOfFinally.cs
+Microsoft.JScript/Convert.cs
+Microsoft.JScript/DateConstructor.cs
+Microsoft.JScript/DateObject.cs
+Microsoft.JScript/DatePrototype.cs
+Microsoft.JScript/DebugBreak.cs
+Microsoft.JScript/Decompiler.cs
+Microsoft.JScript/DocumentContext.cs
+Microsoft.JScript/Empty.cs
+Microsoft.JScript/Enum.cs
+Microsoft.JScript/EnumeratorConstructor.cs
+Microsoft.JScript/EnumeratorObject.cs
+Microsoft.JScript/EnumeratorPrototype.cs
+Microsoft.JScript/Equality.cs
+Microsoft.JScript/ErrorConstructor.cs
+Microsoft.JScript/ErrorObject.cs
+Microsoft.JScript/ErrorPrototype.cs
+Microsoft.JScript/Eval.cs
+Microsoft.JScript/EvalErrorObject.cs
+Microsoft.JScript/Expando.cs
+Microsoft.JScript/FieldAccessor.cs
+Microsoft.JScript/ForIn.cs
+Microsoft.JScript/FormalParameterList.cs
+Microsoft.JScript/FunctionConstructor.cs
+Microsoft.JScript/FunctionDeclaration.cs
+Microsoft.JScript/FunctionExpression.cs
+Microsoft.JScript/FunctionObject.cs
+Microsoft.JScript/FunctionPrototype.cs
+Microsoft.JScript/FunctionWrapper.cs
+Microsoft.JScript/GlobalObject.cs
+Microsoft.JScript/Globals.cs
+Microsoft.JScript/GlobalScope.cs
+Microsoft.JScript/IdentificationTable.cs
+Microsoft.JScript/IActivationObject.cs
+Microsoft.JScript/IAuthorServices.cs
+Microsoft.JScript/IColorizeText.cs
+Microsoft.JScript/IDebugConvert.cs
+Microsoft.JScript/IDebuggerObject.cs
+Microsoft.JScript/IDebugScriptScope.cs
+Microsoft.JScript/IDebugType.cs
+Microsoft.JScript/IDebugVsaScriptCodeItem.cs
+Microsoft.JScript/IDefineEvent.cs
+Microsoft.JScript/IEngine2.cs
+Microsoft.JScript/IErrorHandler.cs
+Microsoft.JScript/IMethodsCompletionInfo.cs
+Microsoft.JScript/INeedEngine.cs
+Microsoft.JScript/IObjectCompletionInfo.cs
+Microsoft.JScript/IParseText.cs
+Microsoft.JScript/IRedirectOutput.cs
+Microsoft.JScript/ISite2.cs
+Microsoft.JScript/ITokenColorInfo.cs
+Microsoft.JScript/ITokenEnumerator.cs
+Microsoft.JScript/IVsaFullErrorInfo.cs
+Microsoft.JScript/IVsaScriptCodeItem.cs
+Microsoft.JScript/IVsaScriptScope.cs
+Microsoft.JScript/InstanceOf.cs
+Microsoft.JScript/Import.cs
+Microsoft.JScript/In.cs
+Microsoft.JScript/IWrappedMember.cs
+Microsoft.JScript/JSBuiltIn.cs
+Microsoft.JScript/JSConstructor.cs
+Microsoft.JScript/JSError.cs
+Microsoft.JScript/JSField.cs
+Microsoft.JScript/JSFieldInfo.cs
+Microsoft.JScript/JSFunctionAttribute.cs
+Microsoft.JScript/JSFunctionAttributeEnum.cs
+Microsoft.JScript/JSLocalField.cs
+Microsoft.JScript/JSMethod.cs
+Microsoft.JScript/JSMethodInfo.cs
+Microsoft.JScript/JSObject.cs
+Microsoft.JScript/JSParser.cs
+Microsoft.JScript/JSPrototypeObject.cs
+Microsoft.JScript/JSPropertyInfo.cs
+Microsoft.JScript/JSScanner.cs
+Microsoft.JScript/JSToken.cs
+Microsoft.JScript/JSVariableField.cs
+Microsoft.JScript/JScriptCodeProvider.cs
+Microsoft.JScript/JScriptCodeGenerator.cs
+Microsoft.JScript/JScriptCodeCompiler.cs
+Microsoft.JScript/JScriptException.cs
+Microsoft.JScript/LateBinding.cs
+Microsoft.JScript/LenientArrayPrototype.cs
+Microsoft.JScript/LenientBooleanPrototype.cs
+Microsoft.JScript/LenientDateConstructor.cs
+Microsoft.JScript/LenientDatePrototype.cs
+Microsoft.JScript/LenientEnumeratorPrototype.cs
+Microsoft.JScript/LenientErrorPrototype.cs
+Microsoft.JScript/LenientFunctionPrototype.cs
+Microsoft.JScript/LenientGlobalObject.cs
+Microsoft.JScript/LenientMathObject.cs
+Microsoft.JScript/LenientNumberPrototype.cs
+Microsoft.JScript/LenientObjectPrototype.cs
+Microsoft.JScript/LenientRegExpPrototype.cs
+Microsoft.JScript/LenientStringConstructor.cs
+Microsoft.JScript/LenientStringPrototype.cs
+Microsoft.JScript/LenientVBArrayPrototype.cs
+Microsoft.JScript/Literal.cs
+Microsoft.JScript/MathObject.cs
+Microsoft.JScript/MemberInfoList.cs
+Microsoft.JScript/MemberInfoInitializer.cs
+Microsoft.JScript/MethodInvoker.cs
+Microsoft.JScript/Missing.cs
+Microsoft.JScript/Namespace.cs
+Microsoft.JScript/NotRecommendedAttribute.cs
+Microsoft.JScript/NumberConstructor.cs
+Microsoft.JScript/NumberObject.cs
+Microsoft.JScript/NumberPrototype.cs
+Microsoft.JScript/NumericBinary.cs
+Microsoft.JScript/NumericUnary.cs
+Microsoft.JScript/ObjectConstructor.cs
+Microsoft.JScript/ObjectPrototype.cs
+Microsoft.JScript/Package.cs
+Microsoft.JScript/Plus.cs
+Microsoft.JScript/PostOrPrefixOperator.cs
+Microsoft.JScript/Print.cs
+Microsoft.JScript/RangeErrorObject.cs
+Microsoft.JScript/ReferenceAttribute.cs
+Microsoft.JScript/ReferenceErrorObject.cs
+Microsoft.JScript/RegExpConstructor.cs
+Microsoft.JScript/RegExpObject.cs
+Microsoft.JScript/RegExpPrototype.cs
+Microsoft.JScript/RegExpMatch.cs
+Microsoft.JScript/Relational.cs
+Microsoft.JScript/ResInfo.cs
+Microsoft.JScript/ReturnOutOfFinally.cs
+Microsoft.JScript/ScriptBlock.cs
+Microsoft.JScript/ScriptFunction.cs
+Microsoft.JScript/ScriptObject.cs
+Microsoft.JScript/ScriptStream.cs
+Microsoft.JScript/SemanticAnalizer.cs
+Microsoft.JScript/SimpleHashtable.cs
+Microsoft.JScript/SourceState.cs
+Microsoft.JScript/StackFrame.cs
+Microsoft.JScript/Statement.cs
+Microsoft.JScript/StrictEquality.cs
+Microsoft.JScript/StringConstructor.cs
+Microsoft.JScript/StringLiteral.cs
+Microsoft.JScript/StringObject.cs
+Microsoft.JScript/StringPrototype.cs
+Microsoft.JScript/SuperTypeMembersSorter.cs
+Microsoft.JScript/SyntaxErrorObject.cs
+../../build/common/MonoTODOAttribute.cs
+Microsoft.JScript/Throw.cs
+Microsoft.JScript/Try.cs
+Microsoft.JScript/TypedArray.cs
+Microsoft.JScript/TypeErrorObject.cs
+Microsoft.JScript/TypeOf.cs
+Microsoft.JScript/TypeReflector.cs
+Microsoft.JScript/UnaryOp.cs
+Microsoft.JScript/URIErrorObject.cs
+Microsoft.JScript/VariableDeclaration.cs
+Microsoft.JScript/VariableStatement.cs
+Microsoft.JScript/VBArrayConstructor.cs
+Microsoft.JScript/VBArrayObject.cs
+Microsoft.JScript/VBArrayPrototype.cs
+Microsoft.JScript/VersionableAttribute.cs
+Microsoft.JScript/VSAITEMTYPE2.cs
+Microsoft.JScript.Vsa/VsaEngine.cs
+Microsoft.JScript/With.cs
+Microsoft.JScript/VsaCodeItem.cs
+Microsoft.JScript/VsaItem.cs
+Microsoft.JScript/VsaItems.cs
+Microsoft.JScript/VsaGlobalItem.cs
+Microsoft.JScript/VsaReferenceItem.cs
+Microsoft.JScript/VsaScriptScope.cs
+Microsoft.JScript/expression.cs
+Microsoft.JScript/Token.cs
+Microsoft.JScript/TokenColor.cs
+Microsoft.JScript/TokenStream.cs
+Microsoft.JScript/Parser.cs
+Microsoft.JScript/TypeManager.cs
View
68 Microsoft.JScript/Microsoft.JScript/ASTList.cs
@@ -0,0 +1,68 @@
+//
+// ASTList.cs: Representation of a collection of source elements
+// that form an Ecmascript program.
+//
+// Author:
+// Cesar Octavio Lopez Nataren
+//
+// (C) 2003, Cesar Octavio Lopez Nataren, <cesar@ciencias.unam.mx>
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Collections;
+using System.Text;
+using System;
+
+namespace Microsoft.JScript {
+
+ public sealed class ASTList : AST {
+
+ internal ArrayList elems;
+
+ internal ASTList (AST parent, Location location)
+ : base (parent, location)
+ {
+ elems = new ArrayList ();
+ }
+
+ internal ASTList Add (AST elem)
+ {
+ elems.Add (elem);
+ return this;
+ }
+
+ internal int Size {
+ get { return elems.Count; }
+ }
+
+ internal override bool Resolve (Environment env)
+ {
+ throw new NotImplementedException ();
+ }
+
+ internal override void Emit (EmitContext ec)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
View
86 Microsoft.JScript/Microsoft.JScript/ActivationObject.cs
@@ -0,0 +1,86 @@
+//
+// ActivationObject.cs:
+//
+// Author: Cesar Octavio Lopez Nataren
+//
+// (C) 2003, Cesar Octavio Lopez Nataren, <cesar@ciencias.unam.mx>
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Diagnostics;
+using System.Collections;
+
+namespace Microsoft.JScript {
+
+ public abstract class ActivationObject : ScriptObject, IActivationObject {
+
+ protected ArrayList field_table;
+
+ protected virtual JSVariableField CreateField (string name, FieldAttributes attrFlags, object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual FieldInfo GetField (string name, int lexLevel)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual Object GetDefaultThisObject ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual GlobalScope GetGlobalScope ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual FieldInfo GetLocalField (string name)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override MemberInfo [] GetMember (string name, BindingFlags bindFlags)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override MemberInfo [] GetMembers (BindingFlags bindFlags)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DebuggerStepThroughAttribute]
+ [DebuggerHiddenAttribute]
+ public Object GetMemberValue (string name, int lexLevel)
+ {
+ FieldInfo field = GetField (name);
+ if (field == null)
+ return null;
+ return field.GetValue (name);
+ }
+ }
+}
View
53 Microsoft.JScript/Microsoft.JScript/ActiveXObjectConstructor.cs
@@ -0,0 +1,53 @@
+//
+// ActiveXObjectConstructor.cs:
+//
+// Author: Cesar Octavio Lopez Nataren
+//
+// (C) 2003, Cesar Octavio Lopez Nataren, <cesar@ciencias.unam.mx>
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Microsoft.JScript {
+
+ public class ActiveXObjectConstructor : ScriptFunction {
+
+ internal static ActiveXObjectConstructor Ctr = new ActiveXObjectConstructor ();
+
+ internal ActiveXObjectConstructor ()
+ {
+ name = "ActiveXObject";
+ }
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasVarArgs)]
+ public new Object CreateInstance (params Object [] args)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public Object Invoke ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
View
39 Microsoft.JScript/Microsoft.JScript/ArgumentsObject.cs
@@ -0,0 +1,39 @@
+//
+// ArgumentsObject.cs:
+//
+// Author:
+// Cesar Lopez Nataren (cnataren@novell.com)
+//
+// (C) 2005, Novell Inc. (http://novell.com)
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace Microsoft.JScript {
+
+ public sealed class ArgumentsObject : JSObject {
+
+ public object callee;
+ public object caller;
+ public object length;
+ }
+}
View
70 Microsoft.JScript/Microsoft.JScript/ArrayConstructor.cs
@@ -0,0 +1,70 @@
+//
+// ArrayConstructor.cs:
+//
+// Author: Cesar Octavio Lopez Nataren
+//
+// (C) Cesar Octavio Lopez Nataren, <cesar@ciencias.unam.mx>
+// (C) 2005, Novell Inc. (http://novell.com)
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+
+namespace Microsoft.JScript {
+
+ public class ArrayConstructor : ScriptFunction {
+
+ internal static ArrayConstructor Ctr = new ArrayConstructor ();
+
+ internal ArrayConstructor ()
+ {
+ _prototype = ArrayPrototype.Proto;
+ _length = 1;
+ name = "Array";
+ }
+
+ public ArrayObject ConstructArray (Object [] args)
+ {
+ throw new NotImplementedException ();
+ }
+
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasVarArgs)]
+ public new ArrayObject CreateInstance (params Object [] args)
+ {
+ if (args == null || args.Length == 0)
+ return new ArrayObject ();
+ else if (args.Length == 1)
+ return new ArrayObject (args [0]);
+ else
+ return new ArrayObject (args);
+ }
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasVarArgs)]
+ public ArrayObject Invoke (params Object [] args)
+ {
+ return CreateInstance (args);
+ }
+ }
+}
View
100 Microsoft.JScript/Microsoft.JScript/ArrayLiteral.cs
@@ -0,0 +1,100 @@
+//
+// ArrayLiteral.cs:
+//
+// Author:
+// Cesar Octavio Lopez Nataren
+//
+// (C) 2003, Cesar Octavio Lopez Nataren, <cesar@ciencias.unam.mx>
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Reflection.Emit;
+
+namespace Microsoft.JScript {
+
+ public class ArrayLiteral : AST, ICanLookupPrototype {
+
+ internal ASTList elems;
+ int skip_count;
+
+ public ArrayLiteral (Context context, ASTList elems)
+ : base (null, null)
+ {
+ this.elems = elems;
+ }
+
+ internal ArrayLiteral (Context context, ASTList elems, int skip_count, Location location)
+ : this (context, elems)
+ {
+ this.skip_count = skip_count;
+ this.location = location;
+ }
+
+ internal override bool Resolve (Environment env)
+ {
+ bool r = true;
+ foreach (AST ast in elems.elems)
+ if (ast != null)
+ r &= ast.Resolve (env);
+ return r;
+ }
+
+ bool ICanLookupPrototype.ResolveFieldAccess (AST ast)
+ {
+ if (ast is Identifier) {
+ Identifier name = (Identifier) ast;
+ Type prototype = typeof (StringPrototype);
+ MemberInfo [] members = prototype.GetMember (name.name.Value);
+ return members.Length > 0;
+ } else
+ return false;
+ }
+
+ internal override void Emit (EmitContext ec)
+ {
+ int i = 0;
+ ILGenerator ig = ec.ig;
+ ArrayList exps = elems.elems;
+ FieldInfo missing = null;
+ if (skip_count != 0)
+ missing = typeof (Missing).GetField ("Value");
+ ig.Emit (OpCodes.Ldc_I4, elems.Size);
+ ig.Emit (OpCodes.Newarr, typeof (object));
+ foreach (AST ast in exps) {
+ ig.Emit (OpCodes.Dup);
+ ig.Emit (OpCodes.Ldc_I4, i);
+ if (ast != null) {
+ ast.Emit (ec);
+ CodeGenerator.EmitBox (ig, ast);
+ } else
+ ig.Emit (OpCodes.Ldsfld, missing);
+ ig.Emit (OpCodes.Stelem_Ref);
+ i++;
+ }
+ ig.Emit (OpCodes.Call, typeof (Globals).GetMethod ("ConstructArrayLiteral"));
+ }
+ }
+}
View
112 Microsoft.JScript/Microsoft.JScript/ArrayObject.cs
@@ -0,0 +1,112 @@
+//
+// ArrayObject.cs:
+//
+// Author: Cesar Octavio Lopez Nataren
+//
+// (C) 2003, Cesar Octavio Lopez Nataren, <cesar@ciencias.unam.mx>
+// (C) 2005, Novell Inc, (http://novell.com)
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+
+namespace Microsoft.JScript {
+
+ public class ArrayObject : JSObject {
+
+ private object _length;
+
+ public virtual object length {
+ get { return _length; }
+ set {
+ uint new_length = Convert.ToUint32 (value);
+ uint old_length = (uint) _length;
+
+ for (uint i = new_length; i < old_length; i++)
+ if (elems.ContainsKey (i))
+ elems.Remove (i);
+
+ _length = new_length;
+ }
+ }
+
+ internal ArrayObject ()
+ {
+ _length = (uint) 0;
+ }
+
+ internal ArrayObject (object o)
+ {
+ IConvertible ic = o as IConvertible;
+ TypeCode tc = Convert.GetTypeCode (o, ic);
+
+ try {
+ if (Convert.IsNumberTypeCode (tc)) {
+ uint size = Convert.ToUint32 (o);
+ if (size >= 0) {
+ _length = size;
+ return;
+ } else {
+ Console.WriteLine ("size = {0}", size);
+ throw new JScriptException (JSError.ArrayLengthConstructIncorrect);
+ }
+ }
+ } catch (FormatException) { /* OK */ }
+
+ elems = new Hashtable ();
+ _length = (uint) 1;
+ elems.Add (0, o);
+ }
+
+ internal ArrayObject (params object [] args)
+ {
+ if (args != null) {
+ uint size = (uint) args.Length;
+ _length = size;
+ elems = new Hashtable ();
+
+ uint idx = 0;
+ foreach (object o in args) {
+ elems.Add (idx, o);
+ idx++;
+ }
+ } else
+ throw new Exception ("args can't be null");
+ }
+
+ internal Hashtable Elements {
+ get { return elems; }
+ }
+
+ protected void SpliceSlowly (uint start, uint deleteCount, object [] args, ArrayObject outArray, uint oldLength, uint newLength)
+ {
+ ArrayPrototype.splice (outArray, null, start, deleteCount, args);
+ }
+
+ internal override object GetDefaultValue (Type hint, bool avoid_toString)
+ {
+ return ArrayPrototype.toString (this);
+ }
+ }
+}
View
488 Microsoft.JScript/Microsoft.JScript/ArrayPrototype.cs
@@ -0,0 +1,488 @@
+//
+// ArrayPrototype.cs:
+//
+// Author:
+// Cesar Lopez Nataren (cesar@ciencias.unam.mx)
+//
+// (C) 2003, Cesar Lopez Nataren
+// (C) 2005, Novell Inc, (http://novell.com)
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using System.Text;
+using Microsoft.JScript.Vsa;
+using System.Globalization;
+
+namespace Microsoft.JScript {
+
+ public class ArrayPrototype : ArrayObject {
+
+ internal static ArrayPrototype Proto = new ArrayPrototype ();
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasThisObject | JSFunctionAttributeEnum.HasEngine |
+ JSFunctionAttributeEnum.HasVarArgs, JSBuiltin.Array_concat)]
+ public static ArrayObject concat (object thisObj, VsaEngine engine,
+ params object [] args)
+ {
+ uint i = 0;
+ ArrayObject result = new ArrayObject ();
+ int arg_idx = -1;
+ int arg_count = args.Length;
+
+ // TODO: Shouldn't this be generic!?
+ SemanticAnalyser.assert_type (thisObj, typeof (ArrayObject));
+ object cur_obj = thisObj;
+
+ ArrayObject cur_ary;
+ while (cur_obj != null) {
+ if (cur_obj is ArrayObject) {
+ cur_ary = (ArrayObject) cur_obj;
+
+ uint n = (uint) cur_ary.length;
+ for (uint j = 0; j < n; j++, i++)
+ result.elems [i] = cur_ary.elems [j];
+ } else
+ result.elems [i++] = cur_obj;
+
+ arg_idx++;
+ cur_obj = arg_idx < arg_count ? args [arg_idx] : null;
+ }
+
+ result.length = i;
+
+ return result;
+ }
+
+ public static ArrayConstructor constructor {
+ get { return ArrayConstructor.Ctr; }
+ }
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasThisObject, JSBuiltin.Array_join)]
+ public static string join (object thisObj, object separator)
+ {
+ // TODO: Shouldn't this be generic!?
+ SemanticAnalyser.assert_type (thisObj, typeof (ArrayObject));
+ ArrayObject array_obj = (ArrayObject) thisObj;
+
+ string _separator;
+ if (separator == null)
+ _separator = ",";
+ else
+ _separator = Convert.ToString (separator);
+
+ Hashtable elems = array_obj.elems;
+ uint n = (uint) array_obj.length;
+ StringBuilder str = new StringBuilder ();
+ bool first = true;
+
+ for (uint i = 0; i < n; i++) {
+ if (!first)
+ str.Append (_separator);
+ first = false;
+ object elem = elems [i];
+ if (elem != null)
+ str.Append (Convert.ToString (elem));
+ }
+ return str.ToString ();
+ }
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasThisObject, JSBuiltin.Array_pop)]
+ public static object pop (object thisObj)
+ {
+ // TODO: Shouldn't this be generic!?
+ SemanticAnalyser.assert_type (thisObj, typeof (ArrayObject));
+ ArrayObject array_obj = (ArrayObject) thisObj;
+ Hashtable elems = array_obj.elems;
+
+ uint n = (uint) array_obj.length;
+ object result = null;
+ if (n > 0) {
+ uint new_len = n - 1;
+ if (elems.ContainsKey (new_len))
+ result = elems [new_len];
+ // Element gets removed automatically
+ array_obj.length = new_len;
+ }
+ return result;
+ }
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasThisObject | JSFunctionAttributeEnum.HasVarArgs, JSBuiltin.Array_push)]
+ public static long push (object thisObj, params object [] args)
+ {
+ // TODO: Shouldn't this be generic!?
+ SemanticAnalyser.assert_type (thisObj, typeof (ArrayObject));
+ ArrayObject array_obj = (ArrayObject) thisObj;
+ Hashtable elems = array_obj.elems;
+
+ uint i = (uint) array_obj.length;
+ long n = i + args.Length;
+
+ for (uint j = 0; i < n; i++, j++)
+ elems [i] = args [j];
+
+ array_obj.length = n;
+ return n;
+ }
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasThisObject, JSBuiltin.Array_reverse)]
+ public static object reverse (object thisObj)
+ {
+ // TODO: Shouldn't this be generic!?
+ SemanticAnalyser.assert_type (thisObj, typeof (ArrayObject));
+ ArrayObject array_obj = (ArrayObject) thisObj;
+ Hashtable elems = array_obj.elems;
+
+ uint n = (uint) array_obj.length;
+ uint half_n = n / 2;
+ uint j = n - 1;
+ object temp;
+
+ for (uint i = 0; i < half_n; i++, j--) {
+ temp = elems [i];
+ elems [i] = elems [j];
+ elems [j] = temp;
+ }
+
+ return array_obj;
+ }
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasThisObject, JSBuiltin.Array_shift)]
+ public static object shift (object thisObj)
+ {
+ // TODO: Shouldn't this be generic!?
+ SemanticAnalyser.assert_type (thisObj, typeof (ArrayObject));
+ ArrayObject array_obj = (ArrayObject) thisObj;
+ Hashtable elems = array_obj.elems;
+
+ uint n = (uint) array_obj.length;
+ object result = null;
+ if (n > 0) {
+ if (elems.ContainsKey ((uint) 0)) {
+ result = elems [(uint) 0];
+ elems.Remove ((uint) 0);
+ for (uint i = 1; i < n; i++)
+ elems [i - 1] = elems [i];
+ }
+ // Last element gets removed automatically
+ array_obj.length = n - 1;
+ }
+ return result;
+ }
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasThisObject | JSFunctionAttributeEnum.HasEngine, JSBuiltin.Array_slice)]
+ public static ArrayObject slice (object thisObj, VsaEngine engine, double start, object end)
+ {
+ // TODO: Shouldn't this be generic!?
+ SemanticAnalyser.assert_type (thisObj, typeof (ArrayObject));
+ ArrayObject array_obj = (ArrayObject) thisObj;
+ uint array_len = (uint) array_obj.length;
+ uint _start, _end;
+
+ if (start > array_len)
+ _start = array_len;
+ else {
+ _start = (uint) start;
+ if (_start < 0)
+ _start += array_len;
+ }
+
+ if (end == null)
+ _end = array_len;
+ else {
+ _end = Convert.ToUint32 (end);
+
+ if (_end < 0)
+ _end += array_len;
+ else if (_end > array_len)
+ _end = array_len;
+ }
+
+ if (_end < _start)
+ _end = _start;
+
+ ArrayObject result = new ArrayObject();
+ result.length = _end - _start;
+
+ for (uint i = _start; i < _end; i++)
+ result.elems [i - _start] = array_obj.elems [i];
+
+ return result;
+ }
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasThisObject, JSBuiltin.Array_sort)]
+ public static object sort (object thisObj, object function)
+ {
+ // TODO: Shouldn't this be generic?
+ SemanticAnalyser.assert_type (thisObj, typeof (ArrayObject));
+ ArrayObject array_obj = (ArrayObject) thisObj;
+ ScriptFunction fun = function as ScriptFunction;
+ uint n = (uint) array_obj.length;
+ if (n > 1)
+ SortHelper.qsort (array_obj.elems, 0, n - 1, SortHelper.CompareDelegateFor (fun));
+ return array_obj;
+ }
+
+ private class SortHelper {
+ internal delegate sbyte CompareDelegate (Hashtable elems, bool b1, object o1, uint i2);
+ private ScriptFunction cmp;
+
+ internal static CompareDelegate CompareDelegateFor (ScriptFunction fun) {
+ if (fun == null)
+ return new CompareDelegate (SortHelper.nativeCompare);
+
+ SortHelper helper = new SortHelper (fun);
+ return new CompareDelegate (helper.userCompare);
+ }
+
+ internal SortHelper (ScriptFunction cmp)
+ {
+ this.cmp = cmp;
+ }
+
+ // Calls a user supplied compare ScriptFunction
+ internal sbyte userCompare (Hashtable elems, bool b1, object o1, uint i2)
+ {
+ bool b2 = !elems.ContainsKey (i2);
+ if (b1 && b2)
+ return 0;
+ else if (b1)
+ return 1;
+ else if (b2)
+ return -1;
+
+ object o2 = elems [i2];
+ if (o1 == null && o2 == null)
+ return 0;
+ if (o1 == null)
+ return 1;
+ else if (o2 == null)
+ return -1;
+
+ int res = Convert.ToInt32 (cmp.Invoke (null, o1, o2));
+ if (res < 0)
+ return -1;
+ else if (res > 0)
+ return 1;
+ else
+ return 0;
+ }
+
+ // Uses a built-in compare function
+ internal static sbyte nativeCompare (Hashtable elems, bool b1, object o1_, uint i2)
+ {
+ bool b2 = !elems.ContainsKey (i2);
+ if (b1 && b2)
+ return 0;
+ else if (b1)
+ return 1;
+ else if (b2)
+ return -1;
+
+ IComparable o1 = o1_ as IComparable;
+ IComparable o2 = elems [i2] as IComparable;
+ if (o1 == null && o2 == null)
+ return 0;
+ if (o1 == null)
+ return 1;
+ else if (o2 == null)
+ return -1;
+
+ return (sbyte) Relational.JScriptCompare (o1, o2);
+ }
+
+ internal static void swap (Hashtable elems, uint i1, uint i2)
+ {
+ object temp = elems [i1];
+ elems [i1] = elems [i2];
+ elems [i2] = temp;
+ }
+
+ internal static uint partition (Hashtable elems, uint left, uint right, CompareDelegate cmp)
+ {
+ uint pivotIndex = left + (uint) MathObject.random_gen.Next ((int) right - (int) left + 1);
+ bool pivotMissing = !elems.ContainsKey (pivotIndex);
+ object pivotValue = elems [pivotIndex];
+ swap (elems, pivotIndex, right);
+ uint storeIndex = left;
+ for (uint i = left; i < right; i++)
+ if (cmp (elems, pivotMissing, pivotValue, i) >= 0)
+ swap (elems, storeIndex++, i);
+ swap (elems, right, storeIndex);
+ return storeIndex;
+ }
+
+ internal static void qsort (Hashtable elems, uint beg, uint end, CompareDelegate cmp)
+ {
+ if (end > beg) {
+ uint index = partition (elems, beg, end, cmp);
+ if (index > 0)
+ qsort (elems, beg, index - 1, cmp);
+ qsort (elems, index + 1, end, cmp);
+ }
+ }
+ }
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasThisObject | JSFunctionAttributeEnum.HasVarArgs | JSFunctionAttributeEnum.HasEngine, JSBuiltin.Array_splice)]
+ public static ArrayObject splice (object thisObj, VsaEngine engine,
+ double start, double deleteCnt,
+ params object [] args)
+ {
+ // TODO: Shouldn't this be generic!?
+ SemanticAnalyser.assert_type (thisObj, typeof (ArrayObject));
+ ArrayObject array_obj = (ArrayObject) thisObj;
+ ArrayObject result = new ArrayObject ();
+ Hashtable elems = array_obj.elems;
+ Hashtable del_elems = result.elems;
+
+ uint old_length = (uint) array_obj.length;
+ start = (long) start;
+ if (start < 0)
+ start = Math.Max (start + old_length, 0);
+ else
+ start = Math.Min (old_length, start);
+
+ deleteCnt = (long) deleteCnt;
+ deleteCnt = Math.Min (Math.Max (deleteCnt, 0), old_length - start);
+
+ uint arg_length = (uint) args.Length;
+ long add_length = (long) ((long) arg_length - (uint) deleteCnt);
+ add_length = (long) Math.Max (add_length, -((long) old_length));
+ long del_length = -add_length;
+ uint new_length = (uint) ((long) old_length + add_length);
+
+ long i, j, m;
+ // First let's make some free space for the new items (if needed)
+ if (add_length > 0) {
+ i = (long) old_length - 1;
+ j = (uint) (i + add_length);
+ for (; i >= start; i--, j--)
+ elems [(uint) j] = elems [(uint) i];
+ }
+
+ // Then insert the new items in the now free space / replace existing ones
+ j = m = 0;
+ long old_start = (long) (start + add_length);
+ for (i = (long) start; j < arg_length; i++, j++) {
+ if (i >= old_start && elems.ContainsKey ((uint) i)) {
+ del_elems [(uint) m] = elems [(uint) i];
+ m++;
+ elems.Remove ((uint) i);
+ }
+
+ if (j < arg_length)
+ elems [(uint) i] = args [(uint) j];
+ }
+
+ // Finally, delete elements which have no replacement elements
+ if (add_length < 0) {
+ uint last_elem_idx = (uint) (i + del_length);
+ for (uint k = 0; k < del_length; i++, j++, k++) {
+ if (elems.ContainsKey ((uint) i)) {
+ del_elems [(uint) m] = elems [(uint) i];
+ m++;
+ elems.Remove ((uint) i);
+ }
+ }
+
+ // And move up trailing elements
+ uint l = (uint) (last_elem_idx - del_length);
+ for (uint k = last_elem_idx; l < old_length; k++, l++) {
+ if (elems.ContainsKey (k))
+ elems [l] = elems [k];
+ else if (elems.ContainsKey (l))
+ elems.Remove (l);
+ }
+ }
+
+ array_obj.length = new_length;
+ result.length = (uint) deleteCnt;
+ return result;
+ }
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasThisObject, JSBuiltin.Array_toLocaleString)]
+ public static string toLocaleString (object thisObj)
+ {
+ // TODO: Shouldn't this be generic!?
+ SemanticAnalyser.assert_type (thisObj, typeof (ArrayObject));
+ ArrayObject array_obj = (ArrayObject) thisObj;
+
+ string separator = CultureInfo.CurrentCulture.TextInfo.ListSeparator + " ";
+
+ Hashtable elems = array_obj.elems;
+ uint n = (uint) array_obj.length;
+ StringBuilder str = new StringBuilder ();
+ bool first = true;
+
+ for (uint i = 0; i < n; i++) {
+ ScriptObject elem = (ScriptObject) Convert.ToObject (elems [i], null);
+ if (!first && elem != null)
+ str.Append (separator);
+ first = false;
+ if (elem != null)
+ str.Append (Convert.ToString (elem.CallMethod ("toLocaleString", new object [] { } )));
+ }
+ return str.ToString ();
+ }
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasThisObject, JSBuiltin.Array_toString)]
+ public static string toString (object thisObj)
+ {
+ SemanticAnalyser.assert_type (thisObj, typeof (ArrayObject));
+ return ArrayPrototype.join (thisObj, null);
+ }
+
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasThisObject | JSFunctionAttributeEnum.HasVarArgs, JSBuiltin.Array_unshift)]
+ public static object unshift (object thisObj, params object [] args)
+ {
+ // TODO: Shouldn't this be generic!?
+ SemanticAnalyser.assert_type (thisObj, typeof (ArrayObject));
+ ArrayObject array_obj = (ArrayObject) thisObj;
+ Hashtable elems = array_obj.elems;
+
+ uint old_length = (uint) array_obj.length;
+ uint arg_length = (uint) args.Length;
+ uint new_length = old_length + arg_length;
+
+ if (arg_length > 0) {
+ // First let's make some free space for the new items
+ long i = (long) old_length - 1;
+ long j = i + (long) arg_length;
+ for (; i >= 0; i--, j--)
+ elems [(uint) j] = elems [(uint) i];
+
+ // Then insert the new items in the now free space
+ for (; j >= 0; j--)
+ elems [(uint) j] = args [(uint) j];
+ }
+ //
+ // NOTE: MSC returns the new array, but
+ // ECMA-262 says to return the new length. We
+ // conform to the standard.
+ //
+ array_obj.length = new_length;
+ return new_length;
+ }
+ }
+}
View
54 Microsoft.JScript/Microsoft.JScript/ArrayWrapper.cs
@@ -0,0 +1,54 @@
+//
+// ArrayWrapper.cs:
+//
+// Author:
+// Cesar Lopez Nataren (cesar@ciencias.unam.mx)
+//
+// (C) 2003, Cesar Lopez Nataren
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Microsoft.JScript {
+
+ public class ArrayWrapper : ArrayObject
+ {
+ public new Type GetType ()
+ {
+ throw new NotImplementedException ();
+ }
+
+
+ public override object length {
+ get { throw new NotImplementedException (); }
+ set {}
+ }
+
+
+ public int Compare (object x, object y)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
View
33 Microsoft.JScript/Microsoft.JScript/AssemblyCustomAttributeList.cs
@@ -0,0 +1,33 @@
+//
+// AssemblyCustomAttributeList.cs:
+//
+// Author: Cesar Octavio Lopez Nataren
+//
+// (C) 2003, Cesar Octavio Lopez Nataren, <cesar@ciencias.unam.mx>
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace Microsoft.JScript {
+ public class AssemblyCustomAttributeList
+ {}
+}
View
67 Microsoft.JScript/Microsoft.JScript/BinaryOp.cs
@@ -0,0 +1,67 @@
+//
+// BinaryOp.cs:
+//
+// Author: Cesar Octavio Lopez Nataren
+//
+// (C) 2003, Cesar Octavio Lopez Nataren, <cesar@ciencias.unam.mx>
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+
+namespace Microsoft.JScript {
+ public abstract class BinaryOp : Exp {
+ protected AST operand1, operand2;
+ protected MethodInfo operatorMeth;
+ protected JSToken operatorTok;
+ protected Type type1, type2;
+
+ protected MethodInfo GetOperator (IReflect ir1, IReflect ir2)
+ {
+ throw new NotImplementedException ();
+ }
+
+ internal BinaryOp (AST parent, AST left, AST right, JSToken op, Location location)
+ : base (parent, location)
+ {
+ operand1 = left;
+ operand2 = right;
+ operatorTok = op;
+ }
+
+ internal JSToken op {
+ get { return operatorTok; }
+ }
+
+ internal AST left {
+ get { return operand1; }
+ set { operand1 = value; }
+ }
+
+ internal AST right {
+ get { return operand2; }
+ set { operand2 = value; }
+ }
+ }
+}
View
67 Microsoft.JScript/Microsoft.JScript/Binding.cs
@@ -0,0 +1,67 @@
+//
+// Binding.cs:
+//
+// Author: Cesar Octavio Lopez Nataren
+//
+// (C) 2003, Cesar Octavio Lopez Nataren, <cesar@ciencias.unam.mx>
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Reflection.Emit;
+
+namespace Microsoft.JScript {
+
+ public abstract class Binding : AST {
+
+ protected MemberInfo defaultMember;
+ protected bool isAssignmentToDefaultIndexedProperty;
+ protected bool isFullyResolved;
+ protected bool isNonVirtual;
+ protected string name;
+
+ protected abstract Object GetObject ();
+ protected abstract void HandleNoSuchMemberError ();
+
+ private Binding ()
+ : base (null, null)
+ {
+ }
+
+ protected void ResolveRHValue ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected abstract void TranslateToILObject (ILGenerator il, Type obtype, bool noValue);
+
+ protected abstract void TranslateToILWithDupOfThisOb (ILGenerator il);
+
+ public static bool IsMissing (Object value)
+ {
+ // FIXME
+ return false;
+ }
+ }
+}
View
89 Microsoft.JScript/Microsoft.JScript/BitwiseBinary.cs
@@ -0,0 +1,89 @@
+//
+// BitwiseBinary.cs:
+//
+// Author:
+// Cesar Lopez Nataren (cesar@ciencias.unam.mx)
+//
+// (C) 2003, Cesar Lopez Nataren
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Diagnostics;
+
+namespace Microsoft.JScript {
+
+ public sealed class BitwiseBinary : BinaryOp {
+
+ public BitwiseBinary (int operatorTok)
+ : base (null, null, null, (JSToken) operatorTok, null)
+ {
+ }
+
+ [DebuggerStepThroughAttribute]
+ [DebuggerHiddenAttribute]
+ public object EvaluateBitwiseBinary (object v1, object v2)
+ {
+ int num1 = Convert.ToInt32 (v1);
+ int num2 = Convert.ToInt32 (v2);
+
+ switch (operatorTok) {
+ case JSToken.BitwiseAnd:
+ return num1 & num2;
+ case JSToken.BitwiseXor:
+ return num1 ^ num2;
+ case JSToken.BitwiseOr:
+ return num1 | num2;
+ case JSToken.LeftShift:
+ return num1 << num2;
+ case JSToken.RightShift:
+ return num1 >> num2;
+ case JSToken.UnsignedRightShift:
+ return UnsignedRightShift (num1, num2);
+ }
+
+ Console.WriteLine ("EvaluateBitwiseBinary: operatorTok = {0}", operatorTok);
+ throw new NotImplementedException ();
+ }
+
+ internal static uint UnsignedRightShift (int num1, int num2)
+ {
+ return (uint) num1 >> num2;
+ }
+
+ internal override bool Resolve (Environment env)
+ {
+ throw new NotImplementedException ();
+ }
+
+ internal override bool Resolve (Environment env, bool no_effect)
+ {
+