1 2006-04-18 Cesar Lopez Nataren <cesar.nataren@medsphere.com>
3 * TokenStream.cs: Ciao to_string.
5 2006-04-18 Miguel de Icaza <miguel@novell.com>
7 * TokenStream.cs: kill to_string method, it was one inneficient
8 way of turning char [] into strings. Use the proper String
11 2006-01-25 Cesar Lopez Nataren <cnataren@novell.com>
13 * FunctionExpression.cs: Set the prefix at resolve time not at
14 constructor time. Solves a bug related to the use of nested
17 2006-01-24 Cesar Lopez Nataren <cnataren@novell.com>
19 * ast.cs (Function.set_prefix): use InFunction and
20 GetContainerFunction for retrieving the container function.
22 * Statement.cs (Return): Implement ICanModifyContext as can return
25 * FunctionDeclaration.cs: Erase unused method Init.
27 2006-01-18 Evan Briones <evan@evanbriones.com>
29 * GlobalObject.cs: parsefloat in ms.net version returns NaN for text strings.
30 If a match is found the regular expression returns its value. Otherwise the
31 value of the object is retained. Previously it would return an empty string if
32 nothing matched making. Double.TryParse would then return 0.
33 Example of this returning NaN : var isnan = 'hello'; print (parseFloat(e));
34 Example of it returning 0 : var iszero = 'string'; print (parseFloat (iszero));
37 2006-01-17 Cesar Lopez Nataren <cnataren@novell.com>
39 * Parser.cs: Propagate the proper parent. Fixes #75166.
41 * ast.cs: Added virtual method PropagateParent for recovering a
42 lost parent or set it up properly if previously set to null.
44 * Statement.cs (If,Jump,Break.PropagateParent): recover
47 * expression.cs (Binary.emit_access): Emit late binding code for
48 member's access that maps to MemberTypes (like Math.pow). Fixes
51 2006-01-13 Cesar Lopez Nataren <cnataren@novell.com>
53 * ForIn.cs: implement for (x in obj) logic.
55 2006-01-11 Cesar Lopez Nataren <cnataren@novell.com>
57 * Parser.cs (StatementHelper): Avoid null reference exception
58 using the new EmptyAST node in case we have an empty stm (Token.SEMI).
60 2006-01-10 Cesar Lopez Nataren <cnataren@novell.com>
62 * Empty.cs: Add internal type EmptyAST.
64 * Parser.cs: Avoid creating a ForIn object when we only have empty
65 condition, test or increment expressions in the loop.
67 2006-01-08 Cesar Lopez Nataren <cnataren@novell.com>
69 * SemanticAnalizer.cs, Import.cs: No longer use the Mono.CSharp
70 stuff; we lookup for the namespaces in our code (stolen from mcs
73 * Namespace.cs: Handle the namespace lookup here.
75 2005-12-15 Cesar Lopez Nataren <cnataren@novell.com>
77 * Parser.cs: Use the new assign ctr and Init method.
78 * expression.cs (Assign): Modify the number of ctr and added the Init method.
79 * BinaryOp.cs: Add setter for left.
81 * Statement.cs (For.Emit): Take into account what relational
84 * expression.cs (Assign.Emit): Emit box in the op= cases.
86 2005-12-10 Florian Gross <flgr@ccan.de> and
87 Evan Briones <evan@evanbriones.com>
89 * ForIn.cs (JScriptGetEnumerator) : Returns a new IEnumerable GetEnumerator.
91 * JSObject.cs (JSObjectEnumerator) : Enumerates the property names.
93 * JScriptException.cs : Added NotCollection exception.
95 * Convert.cs (ToForInObject): If value isn't null
96 returns GlobalObject.Object.CreateInstance(value)
98 * LateBinding.cs : Added StringObject for getting and setting
101 2005-12-10 Cesar Lopez Nataren <cnataren@novell.com>
103 * CodeGenerator.cs: Add EmitAssignAsExp.
105 * expression.cs: Take care of uses of assigment in a expression
106 context; we must save the right-side value in a local and then
107 load the local. Added Assign.EmitAndReturnBuilder.
109 2005-11-25 Cesar Lopez Nataren <cnataren@novell.com>
111 * With.cs (JScriptWith): Use Convert.Object before we cast to
112 ScriptObject as literals fail to be put in the scope chain's
115 * expression.cs (Call.Emit): implement the case when the invoked
116 method at call is a property.
118 * Latebinding.cs: return null in case we don't mach anything.
120 2005-11-22 Cesar Lopez Nataren <cnataren@novell.com>
122 * Statement.cs (Return.Resolve): Added field exp_returns_void
123 which allow us to return a method call as the return expression
124 value even when the method call returns void; we emit null in such
127 * ast.cs (Function): switch from 'protected' to 'internal'
128 property HandleReturnType.
130 2005-11-21 Cesar Lopez Nataren <cnataren@novell.com>
132 * Statement.cs (class Switch): Preserve the value of
133 EmitContext.LoopEnd as can be overriden in nested blocks, for
134 example in a switch statement inside a for-loop.
136 2005-10-28 Raja R Harinath <rharinath@novell.com>
138 * Import.cs (Resolve): Update to changes in GMCS.
139 * SemanticAnalizer.cs (ComputeNamespace): Likewise.
141 2005-10-23 Florian Gross <flgr@ccan.de>
143 * LateBinding.cs: Changed to accept object instead of ScriptObject in a lot of places
145 2005-10-23 Raja R Harinath <harinath@gmail.com>
147 * Import.cs (Resolve): Update to changes in MCS code.
149 2005-10-11 Cesar Lopez Nataren <cnataren@novell.com>
151 * CodeGenerator.cs (CodeGenerator): EmitRelationalComp handle 'in'
154 * Add support for multiple files compilation. This involved addig
155 an extra pass into the AST for ensuring the resolve process, this
156 pass is named PopulateContext. The AST nodes that implement
157 ICanModifyContext call PopulateContext.
159 * IdentificationTable.cs: Added class Environment, which is a
160 symbol table which takes into account namespace info, this is for
161 package statement future implementation.
163 2005-09-30 Cesar Lopez Nataren <cnataren@novell.com>
165 * expression.cs (Expression::Resolve): check if we have an
166 assigment in a chain of expressions and stms, it fixes
167 #75801, and give us 660 more successful tests.
169 2005-09-13 Cesar Lopez Nataren <cnataren@novell.com>
171 * SemanticAnalyser.cs: Add field assemblies. Run now receives the
172 assembly's array, add method ComputeNamespaces,
173 * Parser.cs: Add support for the 'import' statement. Add field
174 code_items, new constructor, methods ParseAll and Import.
175 * Import.cs: Implement Resolve and Emit methods.
176 * ScriptBlock.cs: Add default ctr.
178 2005-09-11 Cesar Lopez Nataren <cnataren@novell.com>
180 * expression.cs (Identifier::emit_undeclared_assignment): Fix
181 small regression related to the value/refs patch. All works again
182 for undeclared variables.
184 2005-09-09 Cesar Lopez Nataren <cnataren@novell.com>
186 * SemanticAnalyser.cs, expression.cs (Unary): Fixes for delete
189 2005-09-08 Cesar Lopez Nataren <cnataren@novell.com>
191 * Relational.cs: The loading of true or false it's generated by
192 EmitRelationalComp not in Relational.Emit as is not always needed.
193 * CodeGenerator.cs: Add EmitRelationalComp.
194 * expression.cs (Args.Emit, emit_default_args_case): take care of
195 Relational operator case.
197 2005-09-06 Florian Gross <flgr@ccan.de>
199 * ObjectPrototype.cs: Implemented better working hasOwnProperty
200 * In.cs: Implemented JScriptIn
201 * LateBinding.cs: Added LateBinding.Delete, HasObjectProperty,
202 DirectHasObjectProperty
204 2005-09-06 Cesar Lopez Nataren <cnataren@novell.com>
206 * CodeGenerator.cs (GetBoxType): Take into account the case where
207 the type is relational whose operator is In.
209 2005-09-02 Cesar Lopez Nataren <cnataren@novell.com>
211 * SemanticAnalyser.cs: Added IsDeletable, check if a property is
212 in an object's constructor.
213 * CodeGenerator.cs: Added JSToken.Delete to GetBoxType.
214 * expression.cs: (Unary) Added field deletable. Take care of the
215 case when the property that we are trying to delete is not
216 deletable, we use late binding's method Delete for that. (Binary)
217 Added property IsDeletable. (Args) Do not pop the values of
218 arguments which implement Exp.
220 2005-08-28 Florian Gross <flgr@ccan.de>
222 * Try.cs: Implemented JScriptExceptionValue
223 * DateConstructor.cs: Adjusted rounding of date values
224 * RegExpPrototype.cs: Truncates lastIndex before using it
225 * With.cs: Implemented JScriptWith -- can't test this yet because
227 * ErrorPrototype.cs: Adjusted toString (no ClassName)
228 * JScriptCodeGenerator.cs: Implemented CreateEscapedIdentifier,
229 CreateValidIdentifier, GenerateAssignStatement, GenerateComment,
230 GenerateConditionStatement, GenerateMethodReturnStatement,
231 GenerateThisReferenceExpression, GenerateThrowExceptionStatement,
232 GenerateVariableDeclarationStatement, IsValidIdentifier,
233 QuoteSnippetString. Added dont_write_semicolon, GetSafeName,
234 FillKeywordTable, keywords. Most of this is very similar to the
235 implementation of the C# CodeGenerator
236 * DatePrototype.cs: prototype's time value is NaN, not 0
237 * Closure.cs: Sets _prototype from func
238 * FunctionObject.cs: Changed prototype of user functions
239 * ErrorObject.cs: Added GetDefaultValue
240 * GlobalObject.cs: parseFloat handles whitespace correctly.
241 Various bug fixes for parseInt
242 * RegExpObject.cs: lastindex changed to double (was int)
244 2005-08-19 Cesar Lopez Nataren <cnataren@novell.com>
246 * SemanticAnalyser.cs: Added ArrayLiteral, StringLiteral,
247 BooleanConstant, ByteConstant, ShortConstant, IntConstant,
248 LongConstant, FloatConstant, DoubleConstant to the
249 prototypes. Added methods IsNumericConstant, NeedsToBoolean.
251 * Parser.cs: Added methods InRangeOf, HasNoDecimals which help on
252 building the property AST node depending on how big and precise
255 * CodeGenerator.cs: (emit_get_default_this) Receives an extra
256 argument which indicates if we are inside a method, use
257 load_engine. Added method EmitBox, EmitConv, GetBoxType
259 * Literal.cs: Add abstract class Constant. Renamed BooleanLiteral
260 to BooleanConstant. Delete NumericLiteral, handle the number code
261 generation properly categorizing in ByteConstant, ShortConstant,
262 IntConstant, LongConstant, FloatConstant and DoubleConstant which
263 inherit from NumericConstant. (ObjectLiteral) Handle boxing issue.
265 * Statement.cs, Relational.cs: (If) Handle boxing issue.
267 * VariableDeclaration.cs: Handle the boxing issue when
268 we have initializers.
270 * Equality.cs, StrictEquality.cs: Handle the boxing issue before invoking
271 EvaluateEquality, JScriptStrictEquals.
273 * ArrayLiteral.cs: Implement ICanLookupPrototype so we can
274 optimize access to methods through the prototype and not
275 generating IL code that uses late binding. Handle the boxing
278 * expression.cs: (Unary.Emit) Nuke emit_unary_op. Take care of
279 properly boxing the operands of methods that evaluate the unary
280 operators at runtime. Fix the minus logic for IL generation, add
281 method emit_non_numeric_unary. Optimize the numeric
282 cases. (Binary) Add LateBinding internal
283 property. (Binary.emit_late_get_or_set, emit_array_access,
284 Conditional.Emit, Call.Emit, emit_print_stm, emit_late_call,
285 setup_late_call_args, EmitBuiltInArgs, Identifier.Emit, Args.Emit,
286 Expression.Emit, Assign.Emit, New.Emit)
287 Take care of properly boxing the built in .NET
288 values. (force_strong_type) Change the type from ParameterInfo to
289 object, take care specifically. (Expression) Add Last internal
290 property. In general, the point is that value types like integers,
291 booleans, etc... do not have to generate a box operation, the user
292 of the arg must handle that.
294 2005-08-17 Florian Gross <flgr@ccan.de>
296 * ScriptObject.cs: Added settable _proto for __proto__. This isn't
297 currently exposed to JScript, but set by
298 FunctionConstructor.CreateInstance. Moved AddField, ClassName,
299 proper_array_index up from JSObject
300 * Constructors: Added _length
301 * JSObject.cs: Moved AddField, ClassName, proper_array_index up to
302 ScriptObject. Added precaching of prototype fields
303 * PostOrPrefixOperator.cs: EvaluatePostOrPrefix correctly promotoes
304 old value to number. Implemented ++obj.a and obj["a"]--
305 * ActivationObject.cs: Added GetMemberValue
306 * expression.cs: Added logic for undeclared variables from cesar and
308 * ObjectPrototype.cs: toString works on ScriptObjects now
309 * JScriptException.cs: Added extra_data for adding details to the
311 * IdentificationTable.cs: Adjusted internal name mapping logic
312 * Bindings.cs: Added stubbed IsMissing
313 * JSFieldInfo.cs: Added SetValue with Binder and CultureInfo stub
314 * Convert.cs: Added IsBoolean, implemented ToString for GlobalScope
315 * LateBindings.cs: Added name, obj constructor. Heavily refactored
316 by adding GetObjectProperty, TryDirectGetObjectProperty,
317 TryGetNativeProperty, DirectSetObjectProperty, TrySetNativeProperty
318 and changed methods to use them. We now do prototypes correctly in
319 general which also slows us down. MapToInternalName does
320 substituation of $ to dollar_. Implemented a simple property cache
321 * BooleanPrototype.cs: Better implementations of toString, valueOf
322 * Parser.cs: Fixed parsing of "in" keyword in argument lists
323 * FunctionPrototype.cs: Works with all ScriptFunctions
324 * RegExpObject.cs: Added extra data to RegExpSyntax exception
325 * GlobalScope.cs: Initializes elems, removed redundant AddField
326 override and implemented stub GetField with lex level
327 * ScriptFunctions.cs: Correctly sets __proto__ on result
329 2005-08-13 Florian Gross <flgr@ccan.de>
331 * DateConstructor.cs, StringConstructor.cs, ObjectConstructor.cs,
332 NumberConstructor.cs, FunctionConstructor.cs, BooleanConstructor.cs,
333 ArrayConstructor.cs, RegExpConstructor.cs, ErrorConstructor.cs:
335 * ScriptObject.cs: Added HasMethod, CallMethod uses
336 SemanticAnalyser.map_to_prototype and forwards engine
337 * ArrayPrototype.cs: Implemented sort, added SortHelper
338 * expression.cs: Implemented delete operator code generation
339 * NumericUnary.cs: Implemented EvaluateUnary (currently unused)
340 * ObjectPrototype.cs: smartToString falls back to toString instead
342 * StringPrototype.cs: Fixed replace logic for replacement functions
343 * FunctionDeclaration.cs: More user function infrastructure
344 * FunctionObject.cs: Implemented ToString for user functions. Moved
345 name, return_type, parameters, ToString up to ScriptFunction.
346 Constructors set _prototype
347 * Closure.cs: More user function infrastructure
348 * Convert.cs: ToString Uses smartToString if no custom toString
350 * BooleanObject.cs: Constructor now uses Convert.ToBoolean
351 * LateBindings.cs: GetMethodFlags logic for anonymous functions.
352 Initial implementation of DeleteMember. Implemented constructor
353 cases in Call and CallValue
354 * Relational.cs: Implemented EvaluateRelational, JScriptCompare
355 * Parser.cs: Fixed bugs in decompiler calls so that the decompiled
356 source code matches the original one
357 * FunctionPrototype.cs: Fixed toString function check
358 * Decompiler.cs: Adjusted indent properties. Made AddEOL not add
359 semicolons to lines which already end with one. Implemented double
361 * SemanticAnalyser.cs: Added more prototype mappings
362 * ErrorConstructor.cs: Added ErrorTypeToName
363 * FunctionExpression.cs: More user function infrastructure
364 * ScriptFunction.cs: Added vsa_engine. Moved name, return_type,
365 parameters, encodedSource, ToString up from FunctionObject.
366 Implemented CreateInstance. Added initial setter for prototype.
367 Added GetDefaultValue
369 2005-08-09 Florian Gross <flgr@ccan.de>
371 * BitwiseBinary.cs: Implement LeftShift, RightShift and
372 UnsignedRightShift evaluation. Add method UnsignedRightShift.
373 * Token.cs: Added field PrintNames, Add flag ignore_error to
375 * Decompiler.cs: Fixes for >>> implementation. Clean up the port.
377 2005-08-09 Cesar Lopez Nataren <cnataren@novell.com>
379 * Parser.cs: Added infrastructure for closure construction support
380 per Florian Gross and Miguel request ;-)
381 * Decompiler.cs: Added to the repository.
383 2005-08-04 Jb Evain <jbevain@gmail.com>
385 * CodeGenerator.cs: write a valid RequestAttribute on the assembly
387 2005-08-03 Florian Gross <flgr@ccan.de>
389 * ScriptObject.cs: Renamed __proto__ to proto for 1.1 compatibility
390 * expression.cs: Uses LateBinding.MapToInternalName to map __proto__
392 * StringPrototype.cs: replace doesn't use anonymous delegate anymore
393 for 1.1 compatibility
394 * JScriptException.cs: Added another case to ErrorMessage.
395 * IdentificationTable.cs: Uses LateBinding.MapToInternalName to map
397 * LateBinding.cs: Added MapToInternalName and changed code to use it.
398 Fixed type mapping with varargs. Unwraps Closure objects to
399 FunctionObjects. Fixed bug in SetField logic
400 * JSObject.cs: Added ClassName for RegExpObject
401 * ArrayPrototype.cs: More uint / int fixes for concat, splice,
403 * StringConstructor.cs: String() ought to be "undefined"
404 * JScriptException.cs: Added code for user exceptions (eg. throw "x")
405 * FunctionObject.cs: Implemented length for user functions
406 * Convert.cs: uint / uint fix for Convert.ToNativeArray
407 * Throw.cs: Implemented JScriptThrow
408 * FunctionPrototype.cs: Correctly throws JSError.FunctionExpected
409 instead of NotImplementedException
410 * ScriptFunction.cs: Added arity as an alias for length (Mozilla)
412 2005-08-02 Cesar Lopez Nataren <cnataren@novell.com>
414 * TokenStream.cs: Display source name and line number.
415 * SemanticAnalizer.cs: Added StringLiteral to prototypes.
416 * Parser.cs: Added Location class, which tracks the SourceName and
417 line number. Build every node from the AST tree with location info.
418 * CodeGenerator.cs: Add emit_default_value.
419 * expression.cs: (Binary.Resolve) Fix for calling directly the
420 method from the prototype if the lhs binary expression is a
421 literal, added ICanLookupPrototype interface. Display the source
422 file name and line number in the errors. (Call) Added field
423 need_this, simplify the logic infering the exact number of
424 parameters from the called method. Added NeedThis. Re-implement
425 Resolve and Emit from Args, delete DesiredNumOfArgs, IsPrint,
426 has_var_args. Added Size, emit_default_args_case. Added location
427 field to FunctionObject. StringLiteral implements ICanLookupPrototype.
428 Fix typo from IAccessible :).
430 * All classes that inherit from abstract class AST: Use
431 constructor from AST that stores the parent and the new info from
434 2005-08-01 Cesar Lopez Nataren <cnataren@novell.com>
436 * Statement.cs (Catch.Emit): Fix for properly emit code for
437 loading the script engine.
439 2005-07-29 Cesar Lopez Nataren <cnataren@novell.com>
441 * All files at current dir: set svn:eol-style to native.
443 2005-07-28 Florian Gross <flgr@ccan.de>
445 * DateConstructor.cs: Sets _prototype. Added DateMod. MakeDay,
446 IsLeapYear, DaysInYear, WeekDay, HourFromTime, MinFromTime,
447 SecFromTime, msFromTime use DateMod (important for negative date
449 * ScriptObject.cs: Added implementation of proprietary __proto__
450 * JSObject.cs: Added more ClassName cases and fixed old ones.
451 GetDefaultValue uses smartToString instead of toString
452 * ArrayPrototype.cs: Added Proto. Switched indices and length values
453 to use uint instead of int so we can represent the full Array size
455 * StringConstructor.cs: Sets _prototype
456 * ObjectConstructor.cs: Sets _prototype
457 * RegExpPrototype.cs: Added Proto. Uses uint instead of int for
458 RegExpMatch length and indices
459 * NumberConstructor.cs: Sets _prototype
460 * expression.cs: force_strong_type always uses ToNumber (fixes
461 broken arguments for Math.pow and so on)
462 * ObjectPrototype.cs: Added Proto. toString is dumb and will output
463 [object Array] when called on an Array instead of using
464 ArrayPrototype.toString. Added smartToString which does the old
466 * StringPrototype.cs: Added Proto. Uses uint instead of int for
468 * JScriptException.cs: Added more cases to Message
469 * ArrayObject.cs: Switched to uint for indices and length
470 * FunctionConstructor.cs: Sets _prototype
471 * Equality.cs: Rewrote equality logic. More cases covered, less code
472 * DatePrototype.cs: Added Proto
473 * Convert.cs: Added ToUint32. ToNumber with Arrays switched to uint
474 * StrictEquality.cs: Added logic for function equality
475 * StringObject.cs: Initializes value to "". Implemented Equals
476 * LateBinding.cs: More cases covered. Added logic for converting
477 arguments to match the signature. Added SetArrayLength. Refactored
478 to use SetArrayLength
479 * BooleanPrototype.cs: Added Proto and empty implementation of
481 * BooleanConstructor.cs: Sets _prototype
482 * FunctionPrototype.cs: Added Proto
483 * NumberPrototype.cs: Added Proto
484 * ArrayConstructor.cs: Sets _prototype
485 * SemanticAnalizer.cs: Added constructor and prototype information
486 to prototypes lookup table
487 * RegExpConstructor.cs: Sets _prototype
488 * ScriptFunction.cs: Added _prototype and implemented prototype
489 using it. Implemented Equals for built-in functions
491 2005-07-28 Cesar Lopez Nataren <cnataren@novell.com>
493 * expression.cs (emit_access): Take into account that __proto__
494 property (Mozilla extension) is contained in ScriptObject.
496 2005-07-27 Cesar Lopez Nataren <cnataren@novell.com>
498 * SemanticAnalizer.cs: Added Boolean/BooleanConstructor and
499 Function/FunctionConstructor. Delete method Dump.
501 2005-07-25 Cesar Lopez Nataren <cnataren@novell.com>
503 * SemanticAnalizer.cs: Added Object/ObjectConstructor to the obj_ctrs.
504 * expression.cs: Fixes error for cases like Constructor.Property.
505 * SemanticAnalizer.cs: Added Array/ArrayConstructor to the ctrs.
507 2005-07-25 Marek Safar <marek.safar@seznam.cz>
509 * IdentificationTable.cs: Fixed build.
511 2005-07-24 Florian Gross <flgr@ccan.de>
513 * DateConstructor.cs: CreateInstance handles Infinity, NaN and double
514 with decimal places correctly and won't fail when trying to get the
515 timezone offset for invalid values anymore. LocalTime keeps the date
516 in the correct timezone
517 * ScriptObject.cs: Moved GetField from JSObject.cs. CallMethod can be
518 used to call ObjectPrototype methods on objects of derived prototypes.
519 * JSObject.cs: Implemented SetMemberValue2, more cases for ClassName,
520 added avoid_toString argument to GetDefaultValue to avoid infinite
521 recursion from ObjectPrototype:toString
522 * ArrayPrototype.cs: Fixed pop, shift to work with the auto-popping
523 ArrayObject:length setter. Implemented toLocaleString
524 * ObjectConstructor.cs: Refactored to use Convert.ToObject. Invoke
525 works with null / undefined argument
526 * StringConstructor.cs: Handles Object []
527 * RegexpPrototype.cs: exec made aware of $_ and UpdateLastMatch
528 * JScriptInstanceOf.cs: Implemented JScriptInstanceof
529 * NumberConstructor.cs: Handles Object []
530 * ObjectPrototype.cs: toString uses GetDefaultValue if available
531 * StringPrototype.cs: match uses UpdateLastMatch, replace works with
532 replacement function, split handles max_count correctly in all cases
533 and calls UpdateLastMatch and handles no match case correctly
534 * IdentificationTable.cs: CreateSymbol mangles "$" to "dollar_" so
535 we can support RegExp.$1, Enter handles case where symbol exists
536 already so that function foo (a, b, a) { } works
537 * ArrayObject.cs: length setter pops elements if new size < old size
538 * ErrorPrototype.cs: Implemented constructor, toString
539 * JSFieldInfo.cs: Implemented Name
540 * DatePrototype.cs: Made toDateString, toLocaleDateString,
541 toLocaleString, toLocaleTimeString, toString, toUTCString handle
542 invalid date value cases
543 * NumericBinary.cs: Refactored to use Convert.ToNumber
544 * Convert.cs: Refactored ToBoolean, ToInt32, ToNumber, ToObject to
545 use IsNumberTypeCode. Added more object cases to ToNumber. ToNumber
546 with string correctly choses parseInt or parseFloat instead of always
547 using parseFloat. Implemented ToNativeArray. Added more cases to
548 ToObject. Fixed ToString with double to be more standards conform
549 * StringObject.cs: Implemented length getter
550 * LateBinding.cs: Added GetMethodFlags, GetRequiredArgumentCount.
551 Made assemble_args ignore trailing unneeded arguments and handle
552 methods that don't have a thisObj argument. Added Invoke logic for
553 Closure, FunctionObject and RegExpObject. Made GetNonMissingValue
554 work correctly for GlobalScope. Correctly sets length when adding
555 index properties to ArrayObjects. Implemented SetValue
556 * GlobalObject.cs: Implemented escape, Function, unescape. Made
557 parseFloat ignore some leading / trailing garbage
558 * FunctionPrototype.cs: Implemented apply, call
559 * RegExpObject.cs: ToString handles empty RegExp case correctly.
560 Initialize made aware of $*. Implemented GetDefaultValue
561 * TokenStream.cs: Handle overflows from float literals
562 * ErrorConstructor.cs: Added ErrorTypeToClass, implemented
564 * RegExpConstructor.cs: RegExpConstructor adds fields for $_,
565 $&, $+, $`, $', $*. Added UpdateLastMatch. Invoke handles zero
566 argument case. Added getters for $1 to $9. Implemented input,
567 lastMatch, lastParen, leftContext, rightContext, multiline
568 * ScriptFunction.cs: Implemented length getter and setter
570 * SyntaxErrorObject.cs, ReferenceErrorObject.cs,
571 TypeErrorObject.cs, ErrorObject.cs, EvalErrorObject.cs,
572 RangeErrorObject.cs, URIErrorObject.cs: Added new ctr, which is used at
573 ErrorConstructor::CreateInstance.
575 * expression.cs: Use Missing.Value for missed parameters in method
578 2005-07-17 Florian Gross <flgr@ccan.de>
580 * DateConstructor.cs: Implemented UTC
581 * ScriptObject.cs: Implemented GetMethod, CallMethod
582 * JSObject.cs: Implemented fallback ToString, more ClassName cases and
583 fallback GetDefaultValue
584 * ArrayPrototype.cs: Fixed concat, join and added splice
585 * RegExpPrototype.cs: Implemented compile, exec, test
586 * expression.cs: Emit JS undef instead of JS null for missing args.
587 * StringPrototype.cs: changed lastIndexOf to be compatible with JSC.
588 Implemented match, replace (no replacement closure), search, split.
589 No longer uses assert_type for ensuring right type of thisObj
590 * ArrayObject.cs: Better length argument handling in constructor. Added
592 * DatePrototype.cs: Added setDate, setFullYear, setHours, setMinutes,
593 setMilliseconds, setMonth, setSeconds, setTime, setUTCDate,
594 setUTCFullYear, setUTCHours, setUTCMinutes, setUTCMilliseconds,
595 setUTCMonth, setUTCSeconds, setYear
596 * FunctionObject.cs: Moved MethodAttributes to ScriptFunction. Added
597 MethodInfo-taking constructor
598 * Convert.cs: Added IsNumber, IsString, ToRegExp. More cases in
599 ToNumber. Refactored ToString
600 * ScriptEquality.cs: More cases
601 * LateBindings.cs: Big refactoring. Introduced assemble_args. Handles
602 missing arguments. build_args can pass null as engine. More CallValue,
603 GetNonMissingValue cases
604 * Plus.cs: Heavily refactored EvaluatePlus from 90 to 12 lines
605 * GlobalObject.cs: Added CollectGarbage
606 * NumberPrototype.cs: No longer uses assert_type for unsuring right
608 * RegExpObject: Added lastIndex, Initialize, stores compiled Regex
609 * SemanticAnalizer: Added missing prototypes. Made assert_type work
611 * ScriptFunction.cs: Moved MethodAttributes from FunctionObject. Added
612 MethodInfo. Implemented Invoke for built-in functions.
614 2005-07-07 Florian Gross <flgr@ccan.de>
616 * MathObject.cs: Implemented max and min (untested)
617 * ObjectConstructor.cs: Implemented Invoke
618 * StringConstructor.cs: Implemented Invoke and fromCharCode
619 * PostOrPrefixOperator.cs: Implemented EvaluatePostOrPrefix
620 * NumberConstructor: Implemented CreateInstance and Invoke
621 * expression.cs: Implemented unary operators void, +, -, !, ~ and !
622 * ArrayPrototype.cs: Implemented concat, push and unshift
623 * DatePrototype.cs: Implemented getDate, getDay, getFullYear, getHours,
624 getMilliseconds, getMinutes, getMonth, getSeconds, getTime,
625 getTimezoneOffset, getUTCDate, getUTCDay, getUTCFullYear, getUTCHours,
626 getUTCMilliseconds, getUTCMinutes, getUTCMonth, getUTCSeconds,
627 getVarDate, getYear, toDateString, toGMTString, toLocaleDateString,
628 toLocaleString, toLocaleTimeString, toString, toTimeString,
629 toUTCString and valueOf
630 * ObjectPrototype.cs: Implemented toLocaleString and valueOf
631 * StringPrototype.cs: Implemented substr and concat
632 * Convert.cs: Implemented ToPrimitive, ToBoolean and ToUint16. Added
633 more cases to IsNumberTypeCode, IsFloatTypeCode and ToInt32. Fixed
634 ToString with doubles
635 * Plus.cs: Added more cases. Fixed endless loop for unknown types via
637 * ArrayObject.cs: Added GetDefaultValue
638 * NumberObject.cs: Added GetDefaultValue
639 * StringObject.cs: Added GetDefaultValue
640 * BooleanObject.cs: Added GetDefaultValue
641 * GlobalObject.cs: Fixed parseFloat. Added parseInt and ScriptEngine*
643 * JSObject.cs: Implemented abstract GetDefaultValue
644 * BitwiseBinary.cs: Implemented &, ^ and | operators
645 * BooleanConstructor.cs: Implemented Invoke
646 * DateConstructor.cs: Implemented infrastructure for DatePrototype.
647 Note: YearFromTime is ported from Rhino. Also implemented Invoke and
649 * NumberPrototype.cs: Implemented toFixed, toLocaleString and toString
650 * TokenStream.cs: Fixed locale dependant float parsing
651 * LateBinding.cs: Added proper support for varargs passing
653 2005-07-06 Cesar Lopez Nataren <cnataren@novell.com>
655 * FunctionExpression.cs (build_closure): Use CodeGenerator.load_engine.
657 * Parser.cs: Restore pn as the parent.
658 * expression.cs: Added is_dynamic_function field to class
659 Call. It's not enough knowing if the parent is a
660 FunctionExpression/FunctionDeclaration, we must assure that we
661 are really inside a FunctionExpression/FunctionDeclaration in
662 order to know in which place is the engine. setup_late_call_args
663 and get_global_scope_or_this used the new field for loading the
666 2005-07-05 Cesar Lopez Nataren <cnataren@novell.com>
668 * LateBinding.cs (CallValue): throw a NotImplementedException
669 instead of a returning null.
672 * FunctionExpression.cs (Emit): use InFunction instead of testing by hand.
673 * Parser.cs (MemberExpr): pass parent as the parameter not pn.
674 * expression.cs (get_global_scope_or_this): use
675 CodeGenerator.load_engine for loading the engine, and invoke
676 GetGlobalScope when the member_exp is a function expression.
678 2005-07-04 Cesar Lopez Nataren <cnataren@novell.com>
681 * expression.cs (emit_late_get_or_set, emit_late_call): Take care the case where
682 the left hand side of a late bound expression is a literal.
683 * SemanticAnalizer.cs: Added IsLiteral method.
685 2005-07-02 Florian Gross <flgr@ccan.de>
687 * ArrayPrototype.cs: Implemented pop, reverse, shift and slice
688 * StringPrototype.cs: Implemented anchor, big, blink, bold, charAt,
689 charCodeAt, fixed, fontcolor, fontsize, indexOf, italics, lastIndexOf,
690 link, localeCompare, slice, small, strike, substring, sup,
691 toLocaleLowerCase, toLocaleUpperCase, toLowerCase, toString, toUpperCase
693 * ArrayObject.cs: ArrayObject-ctor works correctly when first argument
694 isn't length and first element gets assigned to 0 slot correctly
695 * NumberObject.cs: Basic constructor / double value made internal
696 * Equality.cs: Added basic logic for TypeCode.Empty, DBNull, Boolean and
698 * FunctionObject.cs: ToString matches that of MS JS.NET for internal
700 * Convert.cs: IsNumberTypeCode and IsFloatTypeCode utility methods, basic
701 implementation of ToInt32 and ToNumber, more cases for ToString
702 * StrictEquality.cs: Initial working implementation
703 * LateBindings.cs: Call works for Methods that don't have HasEngine and
704 support for getting methods (as in "foo".link) in GetNonMissingValue
705 * Plus.cs: Added support for more types
706 * GlobalObject.cs: Implemented isNaN, isFinite and parseFloat
707 * FunctionPrototype.cs: Implemented toString
708 * NumberPrototype.cs: Implemented valueOf
709 * Globals.cs: Implemented ConstructArrayLiteral
710 * TypeOf.cs: Added more cases
712 2005-06-10 Cesar Lopez Nataren <cnataren@novell.com>
714 * LateBinding.cs: Added field right_hand_side. Initial
715 implementation of Call. Added build_args method. Initial
716 implementation of GetNonMissingValue.
717 * Convert.cs (ToObject): Add return values for TypeCode.String,
718 TypeCode.Boolean, and TypeCode.Object.
719 * RegExpPrototype.cs (toString): Implemented.
720 * RegExpObject.cs: Implemented.
721 * RegExpConstructor.cs: Implement Construct, CreateInstance, and Invoke.
723 2005-06-06 Cesar Lopez Nataren <cnataren@novell.com>
725 * expression.cs (emit_access): We can now access the properties
726 from the Global RegExp object, they were not being accesible
727 because they are properties not fields.
729 2005-05-31 Cesar Lopez Nataren <cnataren@novell.com>
731 * SemanticAnalizer.cs: Add the global, non-constructable RegExp
732 constructor object to obj_ctrs so we can type-check its property
733 access as well as fixing the break showed at #74681 now the raise
734 the proper error code. Renamed method object_contains_method to
735 object_contains, and now we filter on instance members too.
736 * expression.cs: use new API from SemanticAnalizer.
738 2005-05-30 Cesar Lopez Nataren <cnataren@novell.com>
740 * Literal.cs: (RegExpLiteral.Emit): Take care of attributes. "g" is
741 global, "i" is case-insensitive and "m" is multi-line.
743 2005-05-19 Cesar Lopez Nataren <cnataren@novell.com>
745 * Parser.cs: Throw NotImplementedException for function
746 declarations that appear inside other statements
747 (FunctionType.ExpressionStatement declarations). Fix the
748 NullReferenceException from #74970. But now exposes #75002.
750 2005-05-18 Marek Safar <marek.safar@seznam.cz>
752 * JScriptCodeGenerator.cs: Stubbed.
754 * JScriptCodeProvider.cs: Implemented.
756 2005-05-17 Cesar Lopez Nataren <cnataren@novell.com>
758 * SemanticAnalizer.cs: Add methods_with_outter_scope_refs and
759 methods_with_vars_used_nested hashtables.
760 AddMethodReferenceOutterScopeVar, AddMethodVarsUsedNested,
761 MethodReferenceOutterScopeVar. OutterScopeVar,
762 MethodVarsUsedNested and VarUsedNested.
763 * CodeGenerator.cs: Add locals_to_stack_frame method and emit_parents.
764 * TypeManager.cs: Add LocalsAtDepth.
765 * VariableDeclaration.cs: keep track of the lexical depth of
767 * FunctionDeclaration.cs: take care of outter scope variables uses.
768 * IdentificationTable.cs: keep track of Catch statement opened blocks.
769 * expression.cs: take care of eval's Net_1_0 and greater
770 versions. Implement the use of variables in nested scopes. For it,
771 we track the variable's scope level and we compare it with the
772 level in which appears if there's a difference supperior to one
773 and the variables wasn't not declared in the global scope we
774 proceed to generate the code that keep tracks of the state of the
775 variables through a StackFrame, in which we copy the local vars
776 prior to the invocation to the nested method which uses a outter
777 scope variable, then we copy back the variables in the StackFrame
778 into de local vars when the invocation finishes.
780 * Try.cs: open a scope indicating that's for a catch block.
782 2005-05-07 Cesar Lopez Nataren <cnataren@novell.com>
784 * MethodInvoker.cs, ScriptObject.cs, BitwiseBinary.cs,
785 ActivationObject.cs, PostOrPrefixOperator, StackFrame.cs,
786 NumericUnary.cs, JSConstructor.cs, Equality.cs, NumericBinary.cs,
787 Convert.cs, LateBinding.cs, Plus.cs, BitwiseBinary.cs,
788 JSMethodInfo.cs, Relational.cs, ScriptFunction.cs : Add missing
791 2005-05-06 Cesar Lopez Nataren <cnataren@novell.com>
793 * Binding.cs: add missing methods and fields.
795 2005-05-03 Cesar Lopez Nataren <cnataren@novell.com>
797 * ReturnOutOfFinally.cs, SyntaxErrorObject.cs, TypeReflector.cs,
798 JSPrototypeObject.cs, ReferenceErrorObject.cs, Namespace.cs,
799 expression.cs (Unary class), Binding.cs, ArrayWrapper.cs,
800 CmdLineOptionParser.cs, TypeErrorObject.cs, JSConstructor.cs,
801 TypedArray.cs, FunctionWrapper.cs, SuperTypeMembersSorter.cs,
802 ContinueOutOfFinally.cs, BlockScope.cs,
803 AssemblyCustomAttributeList.cs, VersionableAttribute.cs,
804 SimpleHashtable.cs, ResInfo.cs, Import.cs,
805 NotRecommendedAttribute.cs, CmdLineException.cs, DebugBreak.cs,
806 VBArrayObject.cs, CmdLineError.cs, TODOAttribute.cs,
807 RegExpMatch.cs, JScriptCodeProvider.cs, RangeErrorObject.cs,: Fixes for API compliance.
809 2005-04-28 Cesar Lopez Nataren <cnataren@novell.com>
811 * BinaryOp.cs, ActivationObject.cs, expression.cs (Args),
812 ArrayLiteral.cs, ArrayObject.cs, IRedirectOutput.cs, ASTList.cs,
813 IVsaScriptScope.cs, ast.cs (AST), BinaryOp.cs,
814 EnumeratorObject.cs, BreakOutOfFinally.cs, Enum.cs,
815 FormalParameterList.cs, FunctionDeclaration.cs, Equality.cs,
816 Closure.cs, Block.cs, Statement.cs, BooleanObject.cs,
817 LenientBooleanPrototype.cs, GlobalObject.cs, BooleanPrototype.cs,
818 CodeGenerator.cs, LenientDateConstructor.cs,
819 LenientGlobalObject.cs, JSToken.cs, MethodInvoker.cs,
820 LenientRegExpPrototype.cs, NumericUnary.cs,
821 LenientArrayPrototype.cs, JSParser.cs, JSPropertyInfo.cs,
822 LenientVBArrayPrototype.cs, LenientStringPrototype.cs,
823 LenientObjectPrototype.cs, With.cs, ScriptBlock.cs, Expando.cs,
824 JSScanner.cs, LenientEnumeratorPrototype.cs, EvalErrorObject.cs,
825 VariableDeclaration.cs, Print.cs, LenientErrorPrototype.cs,
826 LenientBooleanPrototype.cs, LenientFunctionPrototype.cs, Literal.cs,
827 LenientMathObject.cs, LenientDatePrototype.cs, Relational.cs,
828 Parser.cs, Throw.cs, VariableStatement.cs, RegExpObject.cs, Eval.cs,
829 SemanticAnalizer.cs, LenientStringConstructor.cs,
830 LenientNumberPrototype.cs, FieldAccessor.cs : Changes for MS API
833 2005-04-18 Cesar Lopez Nataren <cnataren@novell.com>
835 * Parser.cs: Build a StrictEquality object instead of a Equality
836 object, when we have === and !=== as operator.
837 * CodeGenerator.cs: (ft_emit_equality, fall_true) Take into account the
838 strict cases of equality.
839 * StrictEquality.cs: Add parent, left and right params to default
840 ctr. Implement Resolve and Emit.
842 2005-04-15 Cesar Lopez Nataren <cnataren@novell.com>
844 * Statement.cs: make internal the builders.
845 * expression.cs: (Identifier.Emit) Take into account if its
846 binding is of type Catch.
848 2005-04-14 Cesar Lopez Nataren <cnataren@novell.com>
850 * SemanticAnalizer.cs: Added a Hashtable that indicates which
851 methods need to generate proper code for handling the local vars
852 in the StackFrame. Added method AddMethodWithEval, MethodContainsEval.
854 * Eval.cs: Back to M.J.
856 * ast.cs: locals from abstract class Function is now an array of
857 objects not just AST's.
859 * CodeGenerator.cs: Clean up fall_true, better using recursion :)
860 Added static method load_local_vars. At method ft_emit_equality do
861 Emit the code of the ast. Added method load_local_vars.
863 * FunctionDeclaration.cs: Update call to TypeManager methods to
864 new API. Added a check for invocations to 'eval' inside functions
865 so StackFrame IL code gets generated. Build the function's closure
866 take the need for the StackFrame into account.
868 * TypeManager.cs: renamed IdentificationTable locals to
869 local_script_functions, AddLocal to AddLocalScriptFunction,
870 GetLocal to GetLocalScriptFunction. Added method CurrentLocals.
872 * IdentificationTable.cs: Method CurrentLocals now returns
873 an array of object's not AST's.
875 * expression.cs: (class Call) Check if we have a call to 'eval',
876 if so we must keep up the StackFrame which contains the local
877 vars. We generate special code that handles the StackFrame with
878 the local vars in order to keep them in sync. When a function
879 contains an invocation to 'eval' even when such function is a
880 function declared in the code we do not perform a direct method
881 call to it when invoked instead a call through late binding gets
882 performed. Added methods IsEval, set_local_vars. Implement 'eval'
885 2005-04-10 Cesar Lopez Nataren <cnataren@novell.com>
887 * StackTrace.cs: Back to M.J namespace.
889 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
891 * Literal.cs: fix the build and broke something else ;-).
893 2005-04-08 Cesar Lopez Nataren <cnataren@novell.com>
895 * Literal.cs: Implement the construction of regular expression literal.
896 * Parser.cs: Pass the proper parent to RegExpLiteral.
898 2005-03-30 Cesar Lopez Nataren <cnataren@novell.com>
900 * TypeOf.cs: take into account Objects.
901 * ArrayConstructor.cs: Implement CreateInstance.
902 * LateBinding.cs: Initial implementatio of CallValue and
903 SetIndexedPropertyValueStatic.
904 * JSFieldInfo.cs: Implement GetValue and SetValue.
905 * ArrayObject.cs: Implement length, add three ctrs.
906 * JScriptException.cs: Add error_number field. Implement
907 ctr. ErrorNumber, Message and StackTrace.
908 * ArrayPrototype.cs: Implement join and toString.
909 * JSObject.cs: Remove the ChainHash, we use a simple hashtable
910 now, the one inherited from ScriptObject.
911 * ScriptObject.cs: Add a Hashtable here.
913 2005-03-29 Cesar Lopez Nataren <cnataren@novell.com>
915 * GlobalScope.cs: Set parent and engine in ctr. Return 'this' for
916 GetDefaultThisObject.
917 * ScriptObject.cs: Added protected 'parent' field of type
920 2005-03-16 Cesar Lopez Nataren <cnataren@novell.com>
922 * FunctionExpression.cs: Update to TypeManager new API.
924 * TypeManager.cs: Keep both MethodBuilder and LocalBuilder around.
926 * FunctionDeclaration.cs: In some contexts we need the
927 MethodBuilder and LocalBuilder, so we must keep both around.
929 * expression.cs: (load_script_func) Take care if bounded variable
930 was declared in a nested context. (emit_create_instance) Handle
931 the FunctionConstructor case.
933 2005-02-28 Cesar Lopez Nataren <cnataren@novell.com>
935 * ForIn.cs: Initial implementation of ForIn stm.
937 2005-02-27 Cesar Lopez Nataren <cnataren@novell.com>
939 * VariableStatement.cs (PopulateContext): Do not add the symbol to
940 the context if already defined in current context.
942 * CodeGenerator.cs: Renamed VariableDefined to variable_defined_in_current_scope.
944 * TypeManager.cs: Reimplemented it, We use an IdentificationTable
945 instead of a simple Hashtable so we can handle scopes
946 properly. Cleaner api.
948 * VariableDeclaration.cs: Use new CodeGenerator api. (EmitDecl)
949 Add the builders to the TypeManager.
951 * Block.cs: Use new TypeManager api.
953 * FunctionDeclaration.cs: Use new TypeManager api. Take care of
954 scopes in the TypeManger on Emit.
956 * IdentificationTable.cs: (Binder) Changed the type of value from
957 AST to object so I can use this symbol table
958 anywhere. (IdentificationTable) Add current_locals stack and added
959 method InCurrentScope.
961 * expression.cs: Use new api from TypeManager, Add casts where neeeded.
963 This solves an infinite loop we were falling into when calling
964 IdentificationTable.CurrentLocals when repeated declarations where
965 inside function declarations.
967 * ast.cs: Added protected field ig to class Function.
968 * Block.cs: Emit function's body in a later phase since free
969 ocurrences of functions - at the same level of it - can be handled
970 properly, since they must be defined and inited to the correct values.
971 * FunctionDeclaration.cs: Renamed Emit to create_closure. And make
972 Emit only generate the code of the body.
976 2005-02-22 Cesar Lopez Nataren <cnataren@novell.com>
978 * Block.cs: Report error JS5040. Reopened #72674, see last comment of it.
980 * CodeGenerator.cs: Added method VariableDefined.
982 * TypeManager.cs: Added method SetMethod.
984 * VariableDeclaration.cs (EmitDecl): Added logic to allow multiple
985 declarations of the same var. Fixes #72674.
987 * Block.cs: Added hashtable ocurrences. It holds the index of the
988 previous declaration which after encountering another one with the
989 same name gets nuked.
991 * FunctionDeclaration.cs: Added logic for allowing multiple
992 declaration of methods with the same name. Fixes #72674.
994 * expression.cs (Args): Added field func. Holds a reference to the
995 Function which to the args are being passed. Use it to track the
996 proper number of arguments for the call.
998 2005-02-20 Cesar Lopez Nataren <cnataren@novell.com>
1000 * expression.cs (Args.Emit): check if num_of_args is -1.
1001 * ast.cs (Function.NumOfArgs): avoid using a null pointer. In the
1002 code generation phase if num_of_args is -1 means the actual
1003 arguments are the desired number of args. Fixes #72697.
1005 * Parser.cs: Pass proper parent.
1006 * CodeGenerator.cs: added emit_get_default_this.
1007 * Literal.cs (This) : Resolve and Emit implemented. Fixes #72477
1008 * expression.cs: (emit_late_get_or_set) use
1009 load_engine. (load_script_func) Ensure that TypeManager has a ref
1010 to the local otherwise it's a field. (New.Resolve) Check if late
1011 binding is needed. (New.Emit) Generate proper IL that make use of
1012 late binding when the id of the constructor it's not part of the
1015 2005-02-14 Cesar Lopez Nataren <cnataren@novell.com>
1017 * Token.cs, TokenStream.cs, Parser.cs: make this classes internal.
1019 * Context.cs: delete wrongly exposed ctr.
1021 2005-02-10 Cesar Lopez Nataren <cnataren@novell.com>
1023 * expression.cs: use InFuntion in proper places.
1025 * Parser.cs: Add parameter that indicates if it's a prefix
1026 operator. When building the MemberExprTail set to proper parent.
1027 * PostOrPrefixOperator.cs: Partial implementation of ++ and --,
1028 prefix and suffix, we assume that the operand is a variable.
1030 2005-02-09 Cesar Lopez Nataren <cnataren@novell.com>
1032 * expression.cs: Added method EmitStore and EmitLoad to Identifier
1033 class. Implemented op= operators. Fixes 72393.
1035 2005-02-08 Cesar Lopez Nataren <cnataren@novell.com>
1037 * expression.cs (Identifier.Emit): Handle case where we are
1038 assigning to a formal parameter. Fixes #72333.
1040 2005-02-06 Cesar Lopez Nataren <cnataren@novell.com>
1042 * expression.cs: (load_script_func) Load localbuilder in an
1043 invocation when needed, this let us have higher order functions,
1044 which is lovely (Fixes #71129). Update calls to load_engine to new signature.
1045 * FunctionDeclaration.cs: Add LocalBuilder to TypeManager.locals
1046 * Statement.cs: Changed ctr to Init, so we can track correctly the
1047 parent hierarchy when building the ast of the program.
1048 * TypeManager.cs: Added field locals. Factored code for
1049 handling the tables. Added enums ManagedType and Operation.
1050 * Parser.cs: Track correctly the parent of return.
1051 * ast.cs (class Function): add ScriptBlock as possible parent of a
1053 * CodeGenerator.cs: change signature of load_engine. Instead of a
1054 AST a boolean. So we can call it with InFunction as parameter.
1056 2005-02-05 Cesar Lopez Nataren <cnataren@novell.com>
1058 * expression.cs: rework the late binding algorithm, we directly
1059 call an object's method if it's a static method of it. Added field
1060 late_bind, properties AccessField and Binding, renamed emit_access
1061 to emit_array_access to class Binary. Added fields params_info,
1062 late_bind and var_args to Class Args; also methods has_var_args,
1063 force_strong_type, reworked its Emit code, we take care of methods
1064 which have variable number of arguments, take care of needed
1065 conversions and boxing when the call has specific strong types as
1066 formal parameters. Added method IsPrint and property Parameters to
1068 * IdentificationTable.cs: Better implementation of jscript's
1069 environments semantics. Added classes Symbol and Binder.
1070 * SymbolTable.cs: Nuked.
1071 * Block.cs: Fix the semantic of semantic analysis and code
1072 generatipo process, we now allow forward declarations of variables
1074 * FunctionDeclaration.cs: Added default ctr and Init method. Fix
1075 the semantics of the Resolve and Emit process, we can have forward
1076 declaration of variables and functions. Fix order in which
1077 JSLocalField's get build.
1078 * FunctionExpression.cs: Fix order in which JSLocalField's get build.
1079 * VariableStatement.cs: Added methods EmitVariableDecls and PopulateContext.
1080 * VariableDeclaration.cs: Added method EmitDecl. Delay the Resolve
1081 and Emit process until the second phase.
1082 * Statement.cs: Resolve process of For class take care of
1083 VariableStatements for populating the environment in advance.
1084 * TypeManager.cs: Make GetMethod return a MethodBuilder.
1085 * ast.cs: Added field locals, property NumOfArgs, method GetName
1086 to abstract class Function.
1087 * SemanticAnalyser.cs: unified global environment and the stack of
1088 contexts. Added field global_obj, adapt methods to new
1089 IdentificationTable api. Delete method ObjectSystemContains. Added
1090 method contains, is_js_object, object_contains_method, map_to_ctr,
1092 * Try.cs: Update to new IdentificationTable api.
1093 * ScriptObject.cs, JSPropertyInfo.cs, FormalParameterList.cs,
1094 JSFieldInfo.cs, JSMethodInfo.cs, JSLocalField.cs,
1095 ScriptFunction.cs: use full namespace name for Binder.
1097 2005-01-17 Cesar Lopez Nataren <cnataren@novell.com>
1099 * CodeGenerator.cs: Added load_engine.
1100 * expression.cs (emit_func_call), FunctionDeclaration.cs: Fix
1101 computation of VsaEngine.
1103 2005-01-11 Cesar Lopez Nataren <cnataren@novell.com>
1105 * StringConstructor.cs: implement CreateInstance.
1107 2005-01-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1109 * BooleanPrototype.cs: update to assert_type.
1110 * SemanticAnalizer.cs: move BooleanPrototype.AssertType here, rename it to assert_type.
1112 2005-01-06 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1114 * BooleanObject.cs: implement ctr's.
1115 * BooleanPrototype.cs: back to M.J namespace. Implement contructor
1116 property, toString and valueOf, add AssertType.
1118 * Convert.cs: add ToString overload and implement.
1120 * JSFieldInfo.cs, JSLocalField.cs: Add conditional NET_2_0 or BOOTSTRAP_NET_2_0 's
1121 Mono_GetGenericFieldDefinition.
1123 * StringObject.cs: add ctrs.
1125 2005-01-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1127 * ObjectPrototype.cs: Add internal ctr. Implement hasOwnProperty.
1128 * ObjectConstructor.cs: implemented CreateInstance.
1129 * expression.cs (emit_create_instance): add Boolean case.
1130 * Try.cs, Statement.cs (EmitStms), Literal.cs
1131 (ObjectLiteralItem.Emit), CodeGenerator.cs (fall_false): delete
1134 2004-12-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1136 * CodeGenerator.cs: add support for compiling not only from cwd.
1138 2004-12-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1140 * expression.cs: emit code for null literal.
1142 2004-12-06 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1144 * expression.cs: added StringConstructor case.
1146 * MemberInfoList.cs: added internal classes Node, ListIter,
1147 ChainHash and implement MemberInfoList.
1148 * JSObject.cs: implement AddField, AddProperty, AddMethod,
1149 GetMembers, RemoveMember, GetEnumerator, add ChainHash's ext
1153 2004-11-30 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1155 * *Prototype.cs: return constructor.
1157 2004-11-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1159 * GlobalObject.cs: return the different kinds of object's
1161 * DateConstructor.cs, StringConstructor.cs, ObjectConstructor.cs,
1162 NumberConstructor.cs, VBArrayConstructor.cs,
1163 FunctionConstructor.cs, EnumeratorConstructor.cs,
1164 BooleanConstructor.cs, ArrayConstructor.cs, RegExpConstructor.cs,
1165 ActiveXObjectConstructor.cs : added default constructor and static
1167 * ErrorConstructor.cs: added default and discriminatory ctrs. Let
1168 us know which type of error we are.
1169 * DateObject.cs: add field that hold the millisecond representation of date.
1170 * JSError.cs, JScriptException.cs: back to Microsoft.JScript namespace.
1171 * DatePrototype.cs: add default ctr.
1173 * MathObject.cs: implement its methods.
1175 2004-11-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1177 * DateConstructor.cs: runtime support, ported parse method from Rhino.
1179 2004-11-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1181 * CodeGenerator.cs: (ff_emit_relational) receive a full
1182 EmitContext as parameter. Added
1183 ff_emit_equality_cond. (fall_false) take where of the case where
1184 an expression is received.
1186 * Parser.cs: use ToJSToken for building the Relational
1187 object. Map relational Token's to JSToken's.
1188 * expression.cs: Added Size property to class
1189 Expression. (emit_create_instance): Added Number code generation.
1191 * Relational.cs (Emit): fix typo, emit boxing to boolean.
1193 2004-11-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1195 * NumericBinary.cs: implement EvaluateNumericBinary.
1197 2004-11-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1199 * CodeGenerator.cs: factor code for fall_true/fall_false (add
1200 emit_default_case, ft_binary_recursion, ft_emit_equality,
1201 ff_emit_relational, ff_binary_recursion). Fix
1202 trouble with logical ops code generation.
1204 2004-11-12 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1206 * TypeOf.cs, Plus.cs, Equality.cs: implementation of
1207 JScriptTypeOf, EvaluatePlus, EvaluateEquality.
1208 * Convert.cs (ToString): use the IConvertible/TypeCode approach
1209 for convertions. Add GetTypeCode.
1211 * Parser.cs, expression.cs: discriminate among =, +=, -=, etc. Add overload of
1214 2004-11-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1216 * expression.cs (emit_late_call): Pop after Call or CallValue when
1217 needed. (New.Emit) add emit_create_instance.
1220 2004-11-08 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1222 * expression.cs (class New): add new operator support. Add
1223 emit_args, implemented Emit.
1225 * expression.cs: emit unary operator code.
1226 * TypeOf.cs: back to Microsoft.JScript namespace. fix typo.
1227 * Literal.cs: constrain more the case of negative numeric literal.
1229 * expression.cs (emit_func_call): pop if function's return type is
1230 non-void and has no effect.
1232 2004-11-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1234 * BinaryOp.cs: added constructor for instantiating derived classes.
1235 * BitwiseBinary.cs, Equality.cs, In.cs, InstanceOf.cs,
1236 NumericBinary.cs, Plus.cs, Relational.cs, StrictEquality.cs,
1237 expression.cs (classes Binary, Assign): use inherited constructor.
1238 * BitwiseBinary.cs, Equality.cs: deleted public constructor which carried the context.
1240 2004-10-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1242 * StringObject.cs: add value field
1244 * expression.cs: implement LateBinding. Added methods:
1245 emit_late_binding, init_late_binding, emit_late_get_or_set,
1246 get_global_scope_or_this, setup_late_call_args, load_script_func, emit_late_call
1247 * Convert.cs: implement CheckIfDoubleIsInteger and CheckIfSingleIsInteger
1249 2004-10-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1251 * ast.cs (Function): added method emit_return_local_field, if
1252 there's a return stm inside a function we must allocate a
1253 JSLocalField indicating the return type of the function.
1254 * FunctionDeclaration.cs, FunctionExpression.cs: generate the
1255 extra JSLocalField if needed
1257 2004-10-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1259 * Parser.cs: set the operator properly.
1261 2004-10-11 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1263 * GlobalObject.cs: ported encodeURI, encodeURIComponent,
1264 decodeURI, decodeURIComponent from Rhino's codebase. Added methods encode and decode.
1266 * expression.cs (Call.Emit): implement IsConstructorProperty.
1268 2004-10-06 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1270 * expression.cs: added support for function calls. Handle case of
1271 print where no args are supplied.
1273 2004-10-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1275 * ast.cs: added GetContainerFunction property.
1276 * Statement.cs: added class NotVoidReturnEventArgs and delegate
1277 NotVoidReturnEventHandler, throw an event in case we find a
1278 return, the enclosing function object takes care of changing the
1279 return type of the function.
1280 * FunctionDeclaration.cs, FunctionExpression.cs: take care of
1281 return's inside functions.
1283 2004-09-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1285 * expression.cs: Binary, use ResolveFieldAccess only in case the operator is JSToken.AccessField.
1287 * Parser.cs: use ToJSToken to set the operator properly.
1288 * FunctionDeclaration.cs: delete spaces.
1290 2004-09-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1292 * FunctionDeclaration.cs: check for parent being a ScriptBlock.
1294 2004-09-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1296 * expression.cs: added semantic analysis for accessing fields on
1297 class Binary. Semantic Analysis for Calls it takes care of
1298 constructors and methods, added invocation code for built in
1299 methods. Added interface IAccesible that let us resolve the '.'
1300 operator. Class Args handles missing or surplus arguments. Added
1301 class BuiltIn which will take care of all builtins of ECMAScript.
1302 * ast.cs: added check for parent equal to ScriptBlock.
1303 * SymbolTable.cs: added method Remove.
1304 * Statement.cs: Added abstract class Jump of which Continue and
1305 Break inherit, checks the label stuff. Added checks for Label
1306 stuff to Continue and Break classes. Added method Init for
1307 DoWhile. Fixes for loops statements in order to be able for have
1308 nested loops. Initial support for Label statements.
1309 * SemanticAnalizer.cs: added hash global_env and
1310 IdentificationTable label_set for keeping track of global methods and
1311 label sets. Added static constructor, method BuildGlobalEnv,
1312 ImplementationName, ObjectSystemContains, AddLabel, ContainsLabel,
1313 GetLabel, RemoveLabel.
1314 * Relational.cs: added code generation for ops instanceof and
1315 in. Fixes for usual relational ops.
1316 * Parser.cs:fixes to keep track of the inheritance chain.
1317 * MathObject.cs: added internal constructor.
1318 * JSFunctionAttribute.cs: added fields value and built_in_function
1319 so we can decide when a method is really a built in.
1320 * IdentificationTable.cs: added method Remove.
1321 * CodeGenerator.cs: fixes for fall_true & fall_false for taking care of ast when is a Expression.
1323 2004-08-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1325 * expression.cs: made Binary is IAssignable, added fields assign
1326 and right_side, added method ResolveAssign (which now receives an
1327 extra parameter, being the right side of the assigment). Take care of being
1328 inside a function for array indexing. Take care of lvalue case
1329 too. Assign.Emit just calls left.Emit since left knows everything
1330 about the right side of the assigment after Resolve process.
1331 * BitwiseBinary.cs, CodeGenerator.cs, Equality.cs, NumericBinary.cs, : updates for BinaryOp change.
1332 * BinaryOp.cs: renamed current_op to op as with the new
1333 parser we no longer need to keep track of the old_op.
1335 2004-08-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1337 * expression.cs: do not pass the operand as a parameter to the
1338 constructor as it gets after the parent gets constructed, same
1339 with binary. Added code generation for array index access.
1340 * Parser.cs: added ToJStoken which converts Token to JSToken,
1341 factored the code for creation the Unary nodes. Take care of
1342 parent relationship.
1343 * LateBinding.cs: back to Microsoft.JScript namespace.
1346 2004-08-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1348 * Parser.cs: pass the skip_count to ArrayLiteral constructor.
1349 * Missing.cs: back to Microsoft.JScript namespace.
1350 * ArrayLiteral.cs: added field skip_count, it tells us if this is
1351 a spaced-arrayliteral, in which case we add a null value in the
1352 list, added null check in the resolve and code generation process.
1354 2004-08-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1356 * expression.cs: added interface ICallable and and function AddArg
1357 to class Call. Added class New.
1358 * driver.cs: made it use the new lexer and parser.
1359 * ast.cs: added field line_number, added property InFunction,
1360 added class Function that factores all the code shared between
1361 FunctionDeclaration and FunctionExpression.
1362 * With.cs: constructor receives line number.
1363 * VariableStatement.cs: constructor receives line number.
1364 * VariableDeclaration.cs: Added check for parent being
1365 FunctionDeclaration and FunctionExpression.
1366 * Try.cs: Moved the code that used to take care of the catch to
1367 Catch class. Constructor receives forming elements and line
1368 number. Removed mangle_id.
1369 * Throw.cs: constructor receives line number.
1370 * Statement.cs: If, DoWhile, Return constructor receives line number. Renamed
1371 identifier to label in Continue and Break class, its constructor now
1372 receives the label and line number. For class, constructor
1373 receives its forming parts. Switch class, constructor receives
1374 line number, added function AddClause and AddStm. Added class
1375 Catch. Added class Labelled.
1376 * SemanticAnalyser.cs: Added field anon_method_counter, properties
1377 NextAnonymousMethod and CurrentAnonymousMethod.
1378 * Parser.cs: function ArgumentList receives a ICallable list
1379 instead of a AST. Now we add the arguments of a callable. Build
1381 * Literal.cs: added constructor for 'this' literal and
1382 ObjectLiteral constructor. Added RegExpLiteral class, will take
1383 care of regular expressions semantic analysis and code generation.
1384 * JSScanner.cs: use no more the antlr based lexer. Fix typo.
1385 * JSParser.cs: make it use the new port of Rhino's Parser.
1386 * FunctionObject.cs: Added constructor that receives the function name.
1387 * FunctionExpression.cs: made it inherit from Function class. Added
1388 constructor. Factored the code that used to set the prefix to
1389 Function.set_prefix (it's shared with FunctionDeclaration). Added
1390 fields local_script_func and field. Implemented Resolve and Emit
1391 (now we can do: var x = function (this, method, is, anonymous) {... };).
1392 * FunctionDeclaration.cs: made it inherit from Function class in
1393 order to share code with FunctionExpression. Added new
1394 constructor. Moved the code that used to built the prefix to
1395 Function inside function set_prefix. When building the closure
1396 added check for setting the type of a FunctionExpression. Moved
1397 set_function_type and set_custom_attr to class Function.
1398 * ForIn.cs: added constructor and fields lhs, obj and body.
1399 * Block.cs: added default constructor and line number based
1400 constructor. Check for elems not being null before adding.
1401 * ArrayLiteral.cs: set elements in constructor.
1403 2004-07-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1405 * Parser.cs: Added ClauseType enum. Added all the statements to current_script_or_fn,
1406 building the other block was not needed. Build the ast's for the
1407 expressions and statements, keep track of the parent relationship.
1409 2004-07-19 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1411 * Added Token.cs, TokenStream.cs, Parser.cs which are the port of
1412 Mozilla/Rhino's parser.
1414 2004-06-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1416 * jscript-lexer-parser.g: added ast building for object_literal,
1417 it's disabled for now while I fix the "block Vs object_literal"
1418 non-determinism problem on the parser. Added rule for
1419 array_literal. Build PropertyName ast build.
1420 * Literal.cs: fixed the negative numbers code generation (we must
1421 optimize this). Added initial ObjectLiteral's class, code generation and
1422 Resolve process. Added class ObjectLiteralItem and PropertyName.
1423 * ArrayLiteral.cs: added internal size field as an ArrayLiteral can have
1424 elisions we keep track of the "real" size here. Added constructor. Added initial
1425 Resolve and Emit code.
1426 * ASTList.cs: added Size property.
1427 * Globals.cs, ASTList.cs: Back to the useful namespace (M.J).
1429 2004-06-20 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1431 * CodeGenerator.cs: Added LoopBegin and LoopEnd to EmitContext, they are used by
1432 break and continue in order to jump to the desired place. Added
1433 check for converting to boolean if we encounter an identifier (at need_convert_to_boolean).
1434 * Statement.cs: class If.Emit, call fall_true instead of fall_false so we don't
1435 need to jump if the expression evaluates to true. Continue class,
1436 replaced ParentIsItrStm with InLoop, emit jump to correct
1437 place. Break class, implemented Resolve; deleted
1438 ParentIsCorrect. DoWhile, While classes, set LoopBegin and
1439 LoopEnd. While class, set LoopBegin and LoopEnd.
1440 * ast.cs: Added InLoop and InSwitch.
1441 * jscript-lexer-parser.g: pass parent to break_stm. Added block as
1442 a statement. Temporarily disabled object_literal in order to test
1443 the block structure and continue and break statements.
1445 2004-05-28 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1447 * Statement.cs: changed parent_is_itr_stm method to ParentIsItrStm
1448 property. Added initial pieces for Break's Resolve. Fixed bug that
1449 did not let Emit the code for case clauses that came after the
1450 default clause (we match the jsc behavior).
1451 * jscript-lexer-parser.g: set parent of switch's clauses.
1453 2004-05-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1455 * Statement.cs: added parent as a parameter on Continue constructor. Added parent_is_itr_stm
1456 * jscript-lexer-parser.g: set parent hierarchy for continue
1457 statement. Set to correct parent in iteration_stm.
1459 2004-05-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1461 * StrictEquality.cs, JSFieldInfo.cs: got it back to Microsoft.JScript namespace.
1463 * Statement.cs: Added code generation support for 'switch' statement.
1465 * jscript-lexer-parser.g: added 'using' for
1466 System.Collections. Allow 'switch' statement building of its
1467 ast. Added parent parameter to constructor of With. Build
1470 * With.cs: code generation support for 'with' stm.
1472 2004-05-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1474 * Statement.cs: initial code generation of 'for'.
1475 * jscript-lexer-parser.g: let's build for's ast.
1477 2004-05-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1479 * jscript-lexer-parser.g: let's build Try/Catch/Finally ast.
1480 * expression.cs: handle Try case for field or local vars allocation.
1481 * Try.cs: implemented Emit.
1482 * Throw.cs: implemented code generation.
1483 * FunctionDeclaration.cs: cache some values.
1485 2004-04-26 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1487 * FunctionDeclaration.cs: let's make function name formation
1488 (get_name ()) a little bit less dumb. We cache the prefix now so
1489 we don't have to recalculate it everytime.
1491 2004-04-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1493 * Literal.cs: emit the correct code for negative numbers.
1494 * jscript-lexer-parser.g: set parent unary_expr.
1496 2004-04-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1498 * expression.cs: added code generation for 'x1 ? x2 :x3' op.
1499 * Statement.cs: Added code generation for while and do-while.
1501 2004-04-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1503 * Statement.cs (class if): reimplemented Emit based on fall_false.
1504 * Equality.cs: added code generation for != and emit jumping code
1505 only in the case we are at a global expression not statement.
1506 * CodeGenerator.cs (fall_true, fall_false): Check if convertion to
1507 boolean needed. Made emit_to_boolean internal. Added need_convert_to_boolean.
1509 2004-04-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1511 * expression.cs (Binary.Emit): treat boolean operator
1512 specially. Added emit_jumping_code.
1513 * CodeGenerator.cs: Added emit_to_boolean. Added fall_true and
1514 fall_false, which will express all boolean expressions and control
1517 2004-04-02 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1519 * Equality.cs: Moved the Emit and Resolve code here.
1520 * jscript-lexer-parser.g: Build a Equality object instead of a
1521 Binary object for equality_expr.
1522 * expression.cs: moved equality oeprators (resolve and IL gen) to
1523 Equality.Emit and Equality.Resolve.
1525 2004-03-31 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1527 * expression.cs: Added shift operators IL emit.
1528 * BitwiseBinary.cs: added constructor for building it according to
1529 JSToken enum. return a new object on EvaluateBitwiseBinary (this
1530 needs a real implementation).
1531 * expression.cs: added code for evaluation of bitwise operators at emit_op_eval.
1533 * Statement.cs: added stub for While and DoWhile ast
1534 representation (reworking my Emit code).
1535 * jscript-parser-lexer.g: allow iteration statement ast build.
1537 * FunctionDeclaration.cs: agrouped code for setting custom attribute.
1539 * expression.cs: added Modulo operator case.
1541 2004-03-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1543 * Convert.cs: added rule for string conversion.
1545 * Plus.cs: added rule for string addition.
1547 * PostOrPrefixOperator.cs: added constructor, returned to Microsoft.JScript ns, initial Resolve and
1548 Emit (cases where there's no real operator).
1550 * StringLiteral.cs: now implements Exp as can appear as a simple
1551 exp in global code. Added check for Pop generation.
1553 * expression.cs: added IL generation code for print func call.
1554 Args class added get_element, Size and made Resolve behave as the
1555 others (collect the differents Resolve's return values from each
1556 of the arguments). Expression class, added default Resolve call
1557 for non-Exp implementers.
1559 * jscript-lexer-parser.g: postfix_expr rule now returns a simple
1560 AST, this handles the case where no postOrPrefixOp present; Unary
1563 * FormalParameterList.cs: added get_element, retrieves nth element.
1565 2004-03-14 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1567 * ScriptStream.cs: let's print some messages.
1569 * jscript-lexer-parser.g (STRING_LITERAL): Do not include the ' in the text of the rule.
1571 2004-03-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1573 * jscript-lexer-parser.g: keep track of return's parent.
1574 * Statement.cs: added parent parameter to constructor.
1576 * expression.cs: refactored Emit code from Identifier, now we take
1577 care of function's paramenter references. First attack to function
1578 calls, check if Resolve from Call succeed.
1580 * VariableDeclaration.cs: Deleted Decl class, field_info and
1581 local_builder fields were being used only by VariableDeclaration,
1582 I'll keep them there.
1584 * FormalParameterList.cs: added field pos to FormalParam, and set
1585 it at FormalParameterList's Resolve stage.
1587 * TODO: updated TODO.
1589 2004-03-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1591 * jscript-lexer-parser.g: build If's ast. Keep track of expr parent.
1593 * expression.cs: At class Conditional renamed fields. Class
1594 Expression inherits from Exp as we must keep track if we must pop
1595 the last value (this is for the comma operator), track the parent,
1596 at Resolve we take care of the last value of the expression,
1598 * VariableDeclaration.cs: updates needed because of EmitContext change.
1600 * Statement.cs: added parent param to If constructor. Implement
1601 Resolve and Emit for If statement.
1603 * Relational.cs: Set parent. The boxing happens in the containing statement.
1605 * FunctionDeclaration.cs: Added func_type field, will be used to determine the
1606 type of the function we are generating (global function, method
1607 from a class, etc) and attach to it the correct custom
1608 attribute. Simplified the code for nested functions:
1609 refactored the code so no code duplication is involved, now we
1610 have only one function that retrieves the name of the function,
1611 now create a new EmitContext for the body of the method.
1613 * FormalParameterList.cs, Literal.cs, StringLiteral.cs: use
1614 current EmitContext's ILGenerator.
1616 * Convert.cs: Do not throw the NotImplementedException anymore for
1617 method ToBoolean, for now we always return false. This must get a
1618 real implementation.
1620 * CodeGenerator.cs: Deleted one of ILGenerator fields
1621 from EmitContext, suffices using only one (more notes about the
1622 change on the Functiondeclaration entry). Imitate jsc behavior for
1623 compiled files names, aggregate the exe or dll extension after last dot.
1625 * Block.cs: In order to implement the comma operator (i.e., expression,
1626 assign_exp), we must track if our expressions are at a global
1627 scope, in which case we must pop the last result too.
1629 2004-01-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1631 * Relational.cs: Initial generation of CIL for relational operators.
1633 2004-01-23 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1635 * jscript-lexer-parser.g: formal_param_list receives a parent too.
1637 * SymbolTable.cs: added size and current_symbols properties.
1639 * JSLocalField.cs: don't throw not ImplementedException from
1640 constructor (same reason, testing purposes, must get implemented
1643 * IdentificationTable.cs: added num_of_locals and current_locals properties.
1645 * FunctionDeclaration.cs: added a LocalBuilder and DictionaryEntry
1646 as fields. Not throw NotImplementedException for
1647 JScriptFunctionDeclaration (testing purposes, must get implemeted
1648 for real). Let's build our function closures! Added functions:
1649 build_closure and build_closure_nested, build_local_fields. Keep
1650 track of current parameters and locals defs.
1652 * FormalParameterList.cs: made FormalParam inherit from
1653 AST. Implement the Emit for parameters, yeah!
1655 * CodeGenerator.cs: added a ModuleBuilder reference. New constructor.
1657 * Closure.cs: do not throw the exception (this allow me to run the
1658 tests at mcs/jtests and check that at least i'm not generating
1659 invalid CIL). Be aware that this must be really implemented.
1661 * Block.cs: renamed field, and implement the double pass for
1662 nested function declarations code emittion, yeah!.
1664 2004-01-16 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1666 * Microsoft.JScript/VsaReferenceItem.cs: renamed field, reuse parent's ctr.
1667 * Microsoft.JScript/VsaItem.cs: renamed some fields, added ctr,
1668 * Microsoft.JScript/VsaGlobalItem.cs: reuse parent ctr.
1669 * Microsoft.JScript/VsaCodeItem.cs: reuse parent ctr.
1670 * Microsoft.JScript/GlobalScope.cs: reuse constructors from parent.
1672 * UnaryOp.cs: inherit from Exp now.
1673 * Plus.cs: Don't throw the exception when calling constructor, let
1674 it build the default handler. Return a new object when calling
1675 EvaluatePlus until properly implemented.
1677 * NumericUnary.cs: added new Resolve.
1678 * NumericBinary.cs: assign operator val at ctr. Return a new
1679 object when calling EvaluateNumericBinary until properly
1680 implemented. Added Resolve.
1681 * Equality.cs: added ctr and return false for EvaluateEquality
1682 until properly implemented. Added Resolve's functions.
1684 * Block.cs (Resolve): That check was not necessary.
1686 * InstanceOf.cs, PostOrPrefixOperator.cs, Relational.cs,
1687 StrictEquality.cs, TypeOf.cs: added Resolve inherited from
1688 BinaryOp and UnaryOp, and this from Exp.
1689 * IdentificationTable.cs, ScriptBlock.cs: deleted debugging messages.
1690 * jscript-lexer-parser.g: deleted debugging messages. Create a
1691 Assign object instance of a simple Binary obj. Same case for Equality.
1693 * expression.cs: added Exp abstract class. Classes that are ast of
1694 language constructions that can appear as global expressions that
1695 get evaluated and then the result is discarded inherit from this
1696 new class. This let meee keep track of things that must get Popped
1697 or can even avoid the evaluation of it. Wrote real Resolve method
1698 for classes: Unary, Binary.
1699 Implemted Emit method for some binary operations (+, -, / and *),
1700 for other operators some more code is still missing.
1701 Identifier: handle assignment cases and global exp cases.
1702 Added class Assign (compisite assignment still missing tough :-(
1704 * driver.cs: deleted debug messages, added "Compilation Succeeded"
1706 * VariableStatement.cs, VariableDeclaration.cs: wrote real Resolve method.
1707 * Literal.cs (BooleanLiteral, NumericLiteral): now inherits from
1708 Exp and handle the case for global expressions that must be popped
1709 after evaluation. no more invalid IL being generated! yeah!
1710 * Block.cs: wrote real Resolve method, erased debug messages.
1711 * BitwiseBinary.cs, InstanceOf.cs, UnaryOp.cs: : add new Resolve inherited from Exp.
1712 * BinaryOp.cs, Conditional: now inherits from Exp.
1714 2004-01-15 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1716 * ReferenceAttribute.cs: moved it back to namespace Microsoft.JScript.
1718 * CodeGenerator.cs: small fixes to generate same things that ms.
1720 2004-01-13 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1722 * VariableDeclaration.cs: get the this.type which is a Type not a TypeBuilder.
1724 2004-01-12 Atsushi Enomoto <atsushi@ximian.com>
1726 * JSMethodInfo.cs : tiny fix for NET_2_0 build.
1728 2003-12-24 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1730 * jscript-lexer-parser.g: keep track of parent reference for
1731 IDENTIFIER, STRING_LITERAL.
1733 * expression.cs: Added 'binding' field. Added 'parent' parameter
1734 to constructor. Now we emit the proper code for the identifier.
1736 * VariableStatement.cs: updated to field names instead of the old
1739 * VariableDeclaration.cs: Added class Decl, it constains the
1740 references to the static field or LocalBuilder that are created
1741 when a declaration is emitted. Deleted unuseful properties (Id,
1744 * SymbolTable.cs: Deleted Retrieve method. Contains now returns an
1745 object instead of a boolean.
1747 * StringLiteral.cs: Deleted unuseful properties. Use ig instead of ec.ig.
1749 * IdentificationTable.cs: Deleted Retrieve method. Contains method
1750 now return an object instead of a boolean, that reference is the
1751 binding associated with the identifier being searched.
1753 2003-12-18 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1755 * jscript-lexer-parser.g: Keep track of parent for numeric_literal.
1757 * VariableDeclaration.cs: now I handle initialization (ex. var x =
1758 2; or function f () { var x = 4; }) at global scope or at
1761 * Literal.cs: Added parent param to NumericLiteral constructor.
1763 * FunctionDeclaration.cs: Added Ret opcode for all function declaration bodies.
1765 2003-12-17 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1767 * CodeGenerator.cs: Added IL emittion for ldnull on default ending code for 'Global Code'.
1769 2003-12-10 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1771 * jscript-lexer-parser.g: added 'tokens { IN = "in"; INSTANCE_OF =
1772 "instanceof"; }' in order to be able to parse both keywords. When
1773 generating the parser, one warning about nondeterminism
1774 (k==1:"in") is generated ignore it.
1776 2003-12-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1778 * jscript-lexer-parser.g: things like 'new Point (10, 20).x' were
1779 not parsable now they are. Mozilla's and Janet's test suites are
1780 being really helpful.
1782 2003-12-05 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1784 * jscript-lexer-parser.g: added check for non-null reference at
1785 var_decl_list rule. Added single quote STRING_LITERAL lexical rule
1786 and multiple lines comments rule.
1788 * jscript-lexer-parser.g: Now I keep track of the parent for most
1789 of the syntatic constructs. Fixed object_literal rule.
1791 * ast.cs: Added field parent. This will help me to track nested
1792 blocks for all of the syntatic constructs and will allow to Emit
1793 everything in one single pass.
1794 * FunctionDeclaration.cs, FunctionExpression.cs: Rearranged the
1796 * Block.cs, FunctionObject.cs: deleted parent field as AST will
1797 hold it. Delete parent parameter from constructor.
1798 * CodeGenerator.cs: Add field gc_ig (global code IL generator) to
1799 EmitContext class. The idea is Emitting everything in one pass (decls
1800 and 'Global Code' method, the parent reference let me know which IL
1801 generator use, gc_ig or ig).
1802 * Equality.cs, BooleanLiteral, Relational.cs: Added new parameter to
1803 constructor. Use new parent reference for choosing the IL
1804 generator. NumericLiteral a 'hard coded' int32 IL emittion added
1806 * StringLiteral.cs, Literal.cs (BooleanLiteral.Emit): now I use
1807 the parent reference to infere which IL generator to use.
1808 * VariableDeclaration.cs: deleted parent field. At Emit, now I use the parent
1809 reference to infer which IL generator to use.
1810 * expression.cs: Added paramenter parent to constructor of: Unary,
1811 Binary, Conditional, Call.
1813 2003-11-30 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1815 * expression.cs: Added new field to Call class, so it can handle more arguments.
1817 * StringLiteral.cs (Emit) : Load the string value.
1819 * Literal.cs: BooleanLiteral, Resolve always return true. Emit the value and box it to Boolean.
1821 * CodeGenerator.cs: Set parent if 'JScript 0' to GlobalScope. Set
1822 custom attribute. Build default 'JScript 0' constructor. Emit
1823 default initial/final code of 'Global Code'. Create default
1826 2003-11-29 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1828 * jscript-lexer-grammar.g: define new rule 'arguments' instead of
1829 repeating hand written rule all around. Change "." for DOT, dumb
1830 mistake by myself. Added rule new_expr. Now we handle properly the
1831 call_expr rule (as defined on the spec), and added a new
1832 argument. Added subrule new_expr to left_hand_side_expr rule.
1834 2003-11-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
1836 * expression.cs (Expression): implemented Emit.
1838 * expression.cs (Binary): Emit now creates a local for the
1839 different kinds of binary expressions (initial code for this).
1841 * ast.cs: Emit method now is abstract instead of virtual.
1843 * CodeGenerator.cs: changed no_global_code_method to is_global_code_method.
1845 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, DebugBreak.cs,
1846 Enum.cs, Equality.cs, Eval.cs, ForIn.cs, FormalParameterList.cs,
1847 FunctionExpression.cs, Import.cs, InstanceOf.cs, Literal.cs,
1848 NumericLiteral, NumericBinary.cs, NumericUnary.cs, Package.cs,
1849 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
1850 Continue, Break, Return, StrictEquality.cs, StringLiteral.cs,
1851 Throw.cs, Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs,
1852 Conditional, Call, Identifier, Args, Expression, :
1855 * FunctionDeclaration.cs: Check if values are not null first (at
1856 Resolve). Ignore code generation is at 'Global Code'.
1858 * VariableDeclaration.cs: Now I take care of IL generation when we
1859 are at statements and expressions at global code, 'Global Code'
1860 method is populated with that IL.
1862 * CodeGenerator.cs: Added flag for 'Global Code' method
1863 emittion. Now I call 'Emit' twice. The first for declarations the
1864 follower for statements and expressions at global scope.
1866 2003-11-10 cesar lopez nataren <cesar@ciencias.unam.mx>
1868 * Visitor.cs: Deleted.
1870 2003-11-09 cesar lopez nataren <cesar@ciencias.unam.mx>
1872 * FormalParameterList.cs: Now inherits from AST. Each of the
1873 formal parameters gets into the IdentificationTable at Resolve.
1875 * FunctionDeclaration.cs:Resolve (), We open a new block when
1876 encountering a FunctionDeclaration, resolve de parameters and the
1877 body, at the end we close the block.
1879 * IdentificationTable.cs: Now we keep track of parent of the
1880 current block. 'Enter (...)' now receives an object, not a
1881 VarDecl. 'Contains' now take care of searching through the binding
1884 * Literal.cs: Deleted 'Literal' class, was being used for
1885 nothing. All the classes the inherited from it, now do it from
1886 AST. A 'literal' does resolve to true by default.
1888 * Relational.cs: Resolve recursively left and right.
1890 * SemanticAnalyser.cs: added flag for 'print statement'.
1892 * Statement.cs: 'If' class, resolves firstly the condition, the true_stm
1895 * driver.cs: Init the semantic analysis phase.
1897 * expression.cs: 'Unary' class, resolves its operand
1898 first. 'Binary' class,resolves left and right first. 'Args' class
1899 resolve all the formal parameters first. 'Expression' resolve all
1900 the nested expressions first.
1902 * jscript-lexer-parser.g: Replaced 'Literal' references for AST ones.
1904 2003-11-08 cesar lopez nataren <cesar@ciencias.unam.mx>
1906 * jscript-lexer-parser.g: Allow the building of numeric_literal and DECIMAL_LITERAL,
1907 this is temporal in order to get Factorial compiled by mjs (must
1908 build the types according to Ecma-262 spec).
1910 * Literal.cs: Added NumericLiteral class.
1912 2003-11-06 cesar lopez nataren <cesar@ciencias.unam.mx>
1914 * FunctionDeclaration.cs: Build a ScriptFunction local variable,
1915 if inside a nested block.
1917 2003-11-05 cesar lopez nataren <cesar@ciencias.unam.mx>
1919 * jscript-lexer-parser.g: Now we take care of parents. This allows
1920 to keep track if we are inside nested blocks. At
1921 'func_decl_or_expr', now I built the FunctionDeclaration or
1922 FunctionExpression first and then assign its body to it - this let
1923 me get a non-null value of the FunctionExpression or
1924 FunctionDeclaration so I can detect if it's a nested block (thanks go to Jackson!).
1926 * Block.cs, FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' field.
1927 * Block.cs, FunctionDeclaration.cs, FunctionExpression.cs,
1928 FunctionObject.cs, VariableDeclaration.cs: Added 'AST parent' parameter to constructor.
1930 * ScriptBlock.cs: Initiate the global block with 'null' as parent.
1932 * FunctionDeclaration.cs: Added 'get_composite_name ()' method
1933 (gets the name of a function if it's nested). Emit code for
1934 function's body. At 'Emit ()' now we take care if it's a nested
1937 * FunctionObject.cs: default return type is 'void' not
1938 'Object'. Function declarations without parameters map to functions with
1939 'Object this' and 'VsaEngine engine' as parameters by
1940 default. Assign parent to nested block.
1942 * VariableDeclaration.cs: At 'Emit ()', now we take care if we are
1943 a global declaration or inside a function declaration.
1945 2003-11-04 cesar lopez nataren <cesar@ciencias.unam.mx>
1947 * FunctionObject.cs: Handle no parameters on functions.
1949 * jscript-lexer-parser.g: Allow functions without parameters.
1951 2003-11-03 cesar lopez nataren <cesar@ciencias.unam.mx>
1953 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Blocks.cs,
1954 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
1955 FunctionDeclaration.cs, FunctionExpression.cs, Import.cs,
1956 InstanceOf.cs, Literal.cs, NumericBinary.cs, NumericUnary.cs,
1957 Package.cs, Plus.cs, PostOrPrefixOperator.cs, Print.cs,
1958 Relational.cs, ScriptBlock.cs, StrictEquality.cs, Throw.cs,
1959 Try.cs, TypeOf.cs, VariableDeclaration.cs, VariableStatement.cs,
1960 With.cs, expression.cs : Added
1961 'Resolve' method stub.
1963 * CodeGenerator.cs: Added a ILGenerator field to EmitContext.
1965 * FormalParameterList.cs: Added FormalParam class. Change Add
1966 method to receive the id and the type annotation from function's parameters.
1968 * FunctionDeclaration.cs: Added code for initial function's
1969 definition code generation.
1971 * FunctionObject.cs: Added MethodAttributes and type_annot
1972 fields. Added params_types function, which returns an array of
1973 types from each of the function's parameters.
1975 * IdentificationTable.cs: Added ToString method.
1977 * SemanticAnalizer.cs: Fixed the file name (maybe I should erase it
1978 and add it again with the correct name). Not based on the Visitor
1979 pattern anymore. Deleted all the VisitFOO methods. Added a
1980 IdentificationTable field. Added Run, Dump methods.
1982 * Statement.cs: Deleted Statement class (it was being used for
1983 nothing). All classes that were having Statement as parent,
1984 changed their parent to be AST.
1986 * SymbolTable.cs: Added Add method that receives the id and the
1987 declaration class. Retrieve changed to return an AST. Added
1988 ToString method. Added 'SymbolTable parent' field.
1990 * VariableDeclaration.cs: Added InitValue property.
1992 * ast.cs: Added some comments and abstract method 'Resolve'.
1994 * jscript-lexer-parser.g: Added parsing support for formal
1995 parameters type annotations.
1997 2003-10-30 cesar lopez nataren <cesar@ciencias.unam.mx>
1999 * jscript-lexer-parser.g: fixed function call parsing! yeah! (give
2002 2003-10-28 cesar lopez nataren <cesar@ciencias.unam.mx>
2004 * jscript-lexer-parser.g: allow empty program files. Added type
2005 annotations on var decl and function decl.
2006 * VariableDeclaration.cs: added return type annotation field.
2007 * FunctionExpression.cs: added return type parameter to constructor.
2008 * FunctionDeclaration.cs: added return type parameter to
2009 constructor. Added Emit method (just creates the static field at
2010 the global object, for now).
2011 * FunctionObject.cs: added return type to constructor. Changed
2012 names to readable ones ;-)
2014 * ScriptStream.cs: added WriteLine.
2016 2003-10-24 cesar lopez nataren <cesar@ciencias.unam.mx>
2018 * ast.cs: Added 'virtual' Emit method (I might change it to be
2019 abstract, but I would have to added to all classes that derive
2020 from it. I'll do it later)
2021 * Block.cs: Added Emit method.
2022 * CodeGnerator.cs: Restructured it (not based on the Visitor pattern
2023 anymore) - still missing some methods, ut on the way. A nice
2024 hacking weekend coming. Added EmitContext class.
2025 * ScriptBlock.cs: Added Emit method.
2026 * VariableDeclaration.cs: Changed type field from string to
2027 Type. Added Emit method.
2028 * VariableStatement.cs: Added Emit method.
2029 * driver.cs: Added CodeGeneration phase (only simple var
2030 declarations support it. More coming soon).
2033 2003-10-22 cesar lopez nataren <cesar@ciencias.unam.mx>
2035 * statement.cs: added Return class.
2037 * Throw.cs: Added expression field, constructor and ToString.
2039 * jscript-lexer-parser.g: Allow return_stm and throw_stm tree
2042 * With.cs: added constructor and ToString. Back to the non-tmp
2045 * jscript-parser-lexer.g: allow with_stm tree building.
2047 * jscript-lexer-parser.g: changed the return type from if_stm from
2048 'If' to AST. Added tree for continue_stm. Allowed building of
2051 * statement.cs: switched to internal 'If' class. Added Continue
2052 class. Added Break class.
2054 * jscript-lexer-parser.g: build tree for function decl or expr.
2056 * FunctionDeclaration.cs: added internal constructor.
2058 * FunctionExpression.cs: added internal constructor.
2060 * FunctionObject.cs: added internal constructor and ToString method.
2062 * jscript-lexer-parser.g: added building tree for if_stm.
2063 * Statement.cs: Added if class for 'if' statement.
2066 2003-10-21 cesar lopez nataren <cesar@ciencias.unam.mx>
2068 * VariableDeclaration.cs: added the initializer to ToString.
2070 * jscript-lexer-parser.g: Allow "christmas trees" (aka expression
2073 * Block.cs, Equality.cs, Relational.cs: modified ToString
2075 * Equality.cs, Relational.cs, StringLiteral.cs,
2076 VariableDeclaration.cs: Added constructor
2078 * VariableStatement.cs, ScriptBlock.cs: changed from hungarian
2079 name convetion style to mono style.
2081 * UnaryOp.cs: added operator and operand fields.
2083 * VariableDeclaration.cs: chenged field name from assignExp to val.
2085 * BinaryOp.cs: Made "internal" the attributes, added the two
2088 * JScriptLexer.cs, JScriptParser.cs, JScriptParserokenTypes.cs,: updates from grammar changes.
2090 * driver.cs: Dump the string representation of the parsed exps.
2092 * Literal.cs: added BooleanLiteral
2094 * Relational.cs: added constructor, ToString,
2096 2003-10-10 cesar lopez nataren <cesar@ciencias.unam.mx>
2098 * README: added some info about hacking the grammar
2100 * JSparser.cs: Updated the constructor to not receiving params.
2102 * JScriptLexer.cs, JScriptParser.cs, JScriptParserTokenTypes.cs,
2103 JScriptParserTokenTypes.txt: update of antlr generated files from
2106 * jscript-lexer-parser.g: Rewrote the EcmaScript grammar. Now we
2107 can parse a little bit more useful programs like:
2109 function factorial (i)
2116 k = factorial (i - 1);
2125 As you can see, it's not the classic factorial function
2126 definition, I still have to make some tricks like storing the
2127 result from the recursive call and then multiply. But this new
2128 grammar it's easier to alter than the old one. Also we got support
2129 for for-in statements, for statements, global expressions, support
2130 for object accesors or better known as the "dot" operator. Two
2131 rules are on the eye: left_hand_size_expr and call_expr, in order
2132 to finish the parsing grammar and fix the bugs.
2135 2003-09-29 <cesar@ciencias.unam.mx>
2137 * Added: VsaGlobalItem.cs, VsaReferenceItem.cs, VsaCodeItem.cs
2139 * Added VsaItem.cs, implements IVsaItem.
2141 2003-09-28 <cesar@ciencias.unam.mx>
2143 * VsaItems.cs: Check that no name is repeated (this was docs fault
2144 :-)). This is the beauty of testing.
2146 * Add VsaItems.cs, implements IVsaItems.
2148 2003-09-22 <cesar@ciencias.unam.mx>
2150 * DocumentContext.cs: changed constructor from internal to public,
2151 this a kind of hack ;), but we can build mjs.exe with that change.
2153 * driver.cs, ast.cs, VsaEngine.cs, VariableStatement.cs,
2154 VariableDeclaration.cs, VBArrayConstructor.cs, StringObject.cs,
2155 StringLiteral.cs, StringConstructor.cs, Statement.cs,
2156 ScriptStream.cs, ScriptObject.cs, ScriptFunction.cs,
2157 ScriptBlock.cs, RegExpObject.cs, RegExpConstructor.cs, Print.cs,
2158 Package.cs, ObjectConstructor.cs, NumberObject.cs,
2159 NumberConstructor.cs, MathObject.cs, Literal.cs,
2160 LenientGlobalObject.cs, JSVariableField.cs, JSToken.cs,
2161 JSScanner.cs, JSParser.cs, JSObject.cs, JSLocalField.cs,
2162 JSFunctionAttributeEnum.cs, JSFunctionAttibute.cs, JSField.cs,
2163 JSBuiltIn.cs, IVsaScriptScope.cs, IRedirectOutput.cs,
2164 IActivationObject.cs, GlobalScope.cs, GlobalObject.cs,
2165 FunctionObject.cs, FunctionExpression.cs, FunctionDeclaration.cs,
2166 FunctionConstructor.cs, FormalParameterList.cs, ErrorObject.cs,
2167 ErrorConstructor.cs, EnumeratorObject.cs,
2168 EnumeratorConstructor.cs, Enum.cs, Empty.cs, DocumentContext.cs,
2169 DateObject.cs, DateConstructor.cs, Context.cs, Closure.cs,
2170 BooleanObject.cs, BooleanConstructor.cs, Block.cs, BinaryOp.cs,
2171 BaseVsaEngine.cs, ArrayObject.cs, ArrayConstructor.cs,
2172 ActiveXObjectConstructor.cs, ActivationObject.cs:
2174 indentation comformance to mono style. Returned to
2175 Microsoft.JScript namespace name. Now we can build
2176 Microsoft.JScript.dll on Linux/Windows, and build mjs.exe on
2177 linux/Windows with our Microsoft.JScript.dll. To build mjs.exe:
2178 $(CSC) /r:Microsoft.JScript.dll driver.cs. Also changed my mind
2179 about the namespace stuff, because I want people
2180 to contribute NUnit tests for Microsoft.JScript public API.
2182 * jscript-lexer-parser.g: Now we are back to Microsoft.JScript namespace.
2184 2003-09-21 <cesar@ciencias.unam.mx>
2186 * jscript-lexer-parser.g: fixed typo and added SEMI_COLON to print_statement.
2188 2003-09-20 <cesar@ciencias.unam.mx>
2190 * jscript-lexer-parser.g: We are little bit closer to the spec on
2191 StringLiteral definition.
2193 * jscript-lexer-parser.g: One line patch, the beauty of tests :-)
2195 * jscript-lexer-parser.g: Build ast for FunctionExpression.
2197 * JSObject.cs: we don't throw NotImplementedException anymore,
2198 this let us use FunctionExpression to build the ast.
2200 * FunctionExpression.cs: Added a FunctionObject as field, a
2201 default constructor.
2203 * FunctionObject.cs: Added default constructor.
2205 * driver.cs: Deleted the Jsc class. We are not generating code
2206 now. I'm moving to provide something like mcs's EmitContext
2207 instead of the CodeGenerator class having the Reflection.Emit
2208 builders and ILGenerator. This driver is just for Lexical and
2209 Parsing phases testing.
2211 * driver.cs: Now we are using the Microsoft.JScript public API
2212 functions to load the lexer and parser.
2214 * ScriptBlock.cs,Block.cs: Added ToString function.
2216 2003-09-20 <cesar@ciencias.unam.mx>
2218 * ASTList.cs, ArrayLiteral.cs, BitwiseBinary.cs, Block.cs,
2219 DebugBreak.cs, Enum.cs, Equality.cs, Eval.cs, ForIn.cs,
2220 FunctionExpression.cs, Import.cs, In.cs, InstanceOf.cs,
2221 Literal.cs, NumericBinary.cs, NumericUnary.cs, Package.cs,
2222 Plus.cs, PostOrPrefixOperator.cs, Print.cs, Relational.cs,
2223 Statement.cs, StrictEquality.cs, StringLiteral.cs, Throw.cs,
2224 Try.cs, TypeOf.cs, VariableDeclaration.cs, With.cs, ast.cs,
2225 : erased Visit method and made some mono indentation style changes.
2227 * CodeGenerator.cs: commented some function calls.
2228 * FunctionDeclaration.cs: moved function attributes to
2229 FunctionObject class, erased Visit method.
2230 * FunctionObject.cs: Here is where we store a function
2231 expression/declaration info, erased Visit method.
2232 * ScriptBlock.cs: Added a Block field, Block will contain the
2234 * jscript-lexer-parser.g: updated the grammar to build the program
2235 representation based on ScriptBlock.
2237 2003-09-19 <cesar@ciencias.unam.mx>
2239 * JSToken.cs: public API compliance.
2241 2003-09-07 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2243 * Context.cs: Added constructor and Document field.
2244 * DocumentContext.cs: Added Name field.
2245 * JSParser.cs: Integration of antlr's generated parser with
2246 JSParser public API. ScriptBlock is now the principal data structure that
2247 represents a Jscript .Net program.
2248 * JSScanner.cs: Integration of antlr's generated lexer with
2249 JSScanner public API.
2251 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2252 * Added files StringLiteral.cs, CodeGenerator.cs and Print.cs.
2254 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2256 * jscript-lexer-parser.g: Changed the namespace to
2257 Microsoft.JScript.Tmp.
2259 * jscript-lexer-parser.g: Fixwd a typo at source_elements rule.
2261 * jscript-lexer-parser.g: Got the name of a
2262 global_function_declaration and also its return type if
2265 * jscript-lexer-parser.g: Added syntatic rule for print_statement.
2266 * jscript-lexer-parser.g: Initial construction of AST for
2267 enum_statement and package_statement.
2269 * jscript-lexer-parser.g: Fixed the enum_statement to accept
2270 empty enum declarations.
2272 * jscript-lexer-parser.g: Got the type of a
2273 veriable_declaration.
2275 * jscript-lexer-parser.g: Initial construction of AST for
2276 primary_expression (in particular literal).
2279 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2281 * driver.cs: Modified the driver structure to be compatible
2282 with our new CodeGenrator and SemanticAnalizer. I
2283 removed the builders from Reflection.Emit to the
2284 CodeGenerator. Added an ASTList, SemanticAnalizer and
2285 CodeGenerator here. Adde methods Run, GenerateCode
2288 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2289 * Statement.cs: Forgot to include it on last commit.
2291 2003-07-27 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2293 * Decided to change temporarly namespace name
2294 Microsoft.JScript to Microsoft.JScript.Tmp in order to be able
2295 to run the code generated by our CIL code generator (on next
2296 commit will come). The problem is that we don't have the
2297 runtime support for our compiler, this involve VsaEngine class
2298 and its "friends", which I have not found a lot of
2299 doumentation for. If someone knows a docs place for them,
2300 don't hesitate to send me a email pointing to them.
2302 * Changed from public to internal Visit function at some
2305 * Package.cs: Added Name and Members fields.
2307 * SemanticAnalizer.cs: Added methods VisitPrint and
2310 * VariableDeclaration.cs: Added Type field.
2312 * Visitor.cs: Changed from public to internal. Added
2313 VisitPrint and VisitStringLiteral methods.
2315 * VsaEngine.cs: Fixed namespace name from Microsoft.JScript to
2316 Microsoft.JScript.Vsa and then to Microsoft.JScript.Vsa.Tmp.
2321 2003-07-22 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2323 * Added CmdLineError.cs and JSError.cs, last night I forgot to
2326 2003-07-21 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2328 ArrayPrototype.cs, ArrayWrapper.cs, BitwiseBinary.cs,
2329 BlockScope.cs, BooleanPrototype.cs, BreakOutOfFinally.cs,
2330 CmdLineException.cs, CmdLineOptionParser.cs,
2331 ContinueOutOfFinally.cs, Convert.cs, DatePrototype.cs,
2332 DocumentContext.cs, EnumeratorPrototype.cs, Equality.cs,
2333 ErrorPrototype.cs, EvalErrorObject.cs, Expando.cs,
2334 FieldAccessor.cs, FunctionPrototype.cs, FunctionWrapper.cs,
2335 Globals.cs, In.cs, InstanceOf.cs, JSConstructor.cs,
2336 JScriptException.cs, JSFieldInfo.cs, JSMethodInfo.cs, JSParser.cs,
2337 JSPrototypeObject.cs, JSScanner.cs, LateBinding.cs,
2338 LenientArrayPrototype.cs, LenientBooleanPrototype.cs,
2339 LenientDateConstructor.cs, LenientDatePrototype.cs,
2340 LenientEnumeratorPrototype.cs, LenientErrorPrototype.cs,
2341 LenientFunctionPrototype.cs, LenientMathObject.cs,
2342 LenientNumberPrototype.cs, LenientObjectPrototype.cs,
2343 LenientRegExpPrototype.cs, LenientStringConstructor.cs,
2344 LenientStringPrototype.cs, LenientVBArrayPrototype.cs,
2345 MemberInfoList.cs, MethodInvoker.cs, Missing.cs, Namespace.cs,
2346 NotRecommendedAttribute.cs, NumberPrototype.cs, NumericBinary.cs,
2347 NumericUnary.cs, ObjectPrototype.cs, Plus.cs,
2348 PostOrPrefixOperator.cs, RangeErrorObject.cs,
2349 ReferenceAttribute.cs, ReferenceErrorObject.cs, RegExpMatch.cs,
2350 RegExpPrototype.cs, Relational.cs, ResInfo.cs,
2351 ReturnOutOfFinally.cs, ScriptStream.cs, SimpleHashtable.cs,
2352 StackFrame.cs, StrictEquality.cs, StringPrototype.cs,
2353 SuperTypeMembersSorter.cs, SyntaxErrorObject.cs, TypedArray.cs,
2354 TypeErrorObject.cs, TypeOf.cs, TypeReflector.cs,
2355 URIErrorObject.cs, VBArrayObject.cs, VBArrayPrototype.cs,
2356 VersionableAttribute.cs
2358 Now, I must fill in the blanks :-)
2361 2003-07-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2362 * jscript-lexer-parser.g: Added conditional_compilation_directive,
2363 which is the beginning of our support for conditional compilation
2364 statements and directives in our parser. Added
2365 cc_on_statement, and some lexer rules for getting the needed
2366 tokens (COND_SET, COND_DEBUG, COND_POSITION, COND_POSITION,
2367 COND_IF, COND_ELIF, COND_ELSE, COND_END and CC_ON.
2370 2003-07-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2372 * jscript-lexer-parser.g: Changed the format of copyright notice.
2374 This changes will allow the support
2375 for the grammar added by MS to EcmaScript (aka its JScript .Net),
2376 I'm still missing some, but they are on the way.
2378 * jscript-lexer-parser.g: Deleted function_declaration, and
2379 added global_function_declaration and type_function_declaration.
2380 I decided to make the grammar as strict as the MS docs mark,
2381 but there's a difference between what their docs says and what
2382 their compiler does. For this case I decided to follow the
2383 docs. A program like:
2384 private function F ()
2386 according to the docs, would not be syntaticly correct. But the MS
2387 compiler, accepts the grammar construct and mark the error at
2388 semantic analysis phase. I followed the docs this time.
2390 * jscript-lexer-parser.g: Added debbuger_statement.
2391 * jscript-lexer-parser.g: Added import_statement.
2392 * jscript-lexer-parser.g: Added package_statement and package_member(s).
2393 * jscript-lexer-parser.g: Added super_statement.
2394 * jscript-lexer-parser.g: Added const_statement.
2395 * jscript-lexer-parser.g: Added class_statement,
2396 interfaces_list and class_members.
2398 * jscript-lexer-parser.g: Added interface_statement and
2401 * jscript-lexer-parser.g: Added enum_statement.
2402 * jscript-lexer-parser.g: Added static_statement. The rule for
2403 this syntatic construc is: static identifier { [body] }
2404 body does not get well specified in the docs. Must search wich
2405 are the possible values of it.
2407 * jscript-lexer-parser.g: At variable_declaration, added
2408 support for explicit type declaration.
2410 * jscript-lexer-parser.g: Added numeric_literal,
2411 DECIMAL_LITERAL and HEX_INTEGER_LITERAL.
2413 * jscript-lexer-parser.g: Added modifiers, modifier, version_modifier.
2416 2003-06-09 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2419 * Added the Visit method to classes: AST, ArrayLiteral, ASTList,
2420 Block, DebugBreak, Eval, ForIn, FunctionDeclaration,
2421 FunctionExpression, Import, Package, ScriptBlock, Throw, Try,
2424 That method will be the driver that will allow classes
2425 that implement the Visitor interface do a walk through the AST's
2426 elements, in particular the Semantic Analizer and the Code
2427 Generator. Every class that inherits from AST will have a Visit
2428 method, that method will receive a Visitor and a object as
2429 parameters, the only thing that it'll do is letting the Visitor
2430 call the respective method VisitX, where X is the name of the
2431 currently visited class.
2433 * ASTList.cs:Added constructor, Add, Visit, ToString methods.
2435 * FunctionDeclaration.cs: Added constructor, Visit and ToString
2438 * jscript-lexer-parser.g: Added a ASTList as a parameter to the
2439 program (the main entry of the parser). Also added as parameters:
2440 - An AST to source_element.
2441 - A Statement to statement.
2442 - A VariableStatement to variable_statement.
2443 - A VariableStatement to variable_declaration_list.
2444 - A FormalParamerList by formal_parameter_list.
2445 - A ASTList by function_body.
2447 And now some rules return objects:
2448 - A VariableDeclaration by variable_declaration.
2449 - A Functiondeclaration by function_declaration.
2451 * driver.cs: Added the construction of the AST of the EcmaScript
2454 * Visitor.cs: Added this file. It's the visitor interface.
2456 * VariableDeclaration.cs: Added this class, it's the AST
2457 representation of a variable declaration.
2459 * Statement.cs: Added this file. It's the logical representation
2462 * VariableStatement.cs: Added this class. It's the AST
2463 representation of a chain of variable declarations.
2465 * FormalParameterList.cs: The function declaration needs to store
2466 its parameter, we will put them on this class.
2468 * SemanticAnalizer.cs: Added this class. I'll use the Visitor pattern in order to
2469 implement the semantic analysis and code generation
2470 phases. SemanticAnalizer and CodeGenerator will implement the
2471 Visitor interface, they will walk a program's
2472 AST tree and do their respective work.
2474 * IdentificationTable.cs: Added this class. The SymbolTable will be used
2475 by the SemanticAnalyzer in order to keep track of the variable
2476 declaration encountered, etc..
2478 * SymbolTable.cs: A simple hashtable but for commodity i'll call
2482 2003-05-03 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
2484 * jscript-lexer-parser.g:
2485 - Deleted the assignment_operator COMPOUND_ASSIGNMENT, and added
2486 MULTIPLICATION_ASSIGN, DIVISION_ASSIGN, REMAINDER_ASSIGN,
2487 ADDITION_ASSIGN, SUBSTRACTION_ASSIGN, SIGNED_LEFT_SHIFT_ASSIGN,
2488 SIGNED_RIGHT_SHIFT_ASSIGN, UNSIGNED_RIGHT_SHIFT_ASSIGN,
2489 BITWISE_AND_ASSIGN, BITWISE_OR_ASSIGN.
2490 - Changed INTERROGATION to CONDITIONAL.
2491 - Changed TRIANGLE to BITWISE_XOR.
2492 - Changed SLASH to DIVISION.
2493 - Changed PERCENT to REMAINDER.
2494 - Changed ADMIRATION to LOGICAL_NOT
2495 - Added BITWISE_NOT (~).
2496 - Added the INCREMENT and DECREMENT rules for
2497 left_hand_side_expression.
2498 - Increased lexer lookup from 2 to 4.
2499 - Redefined the definitions of: L_THAN, G_THAN, MINUS, TIMES,
2500 BITWISE_AND, BITWISE_OR,
2501 - Added operator: EQUALS, DOES_NOT_EQUALS, STRICT_EQUALS,
2502 REMAINDER, UNSIGNED_RIGHT_SHIFT.
2503 - Added the recursion rules for equality_expression.
2504 - Added the recursion rules for shift_expression.
2506 - The most important thing, added support for expressions like:
2509 2003-04-20 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2512 - Erased the Context class, it was used for the first
2513 test of the print_statement and Reflection.Emit. As I erased the
2514 Program, SourceElements, SourceElement from the ANTLR grammar (for
2515 the rework of the AST tied to the MS JScript public API), I erased
2517 - Erased the methods: EmitJScript0Type, EmitJScript0Cons,
2518 EmitGlobalCode, EmitJScript0, EmitJScriptMainType,
2519 EmitJScriptMainCons, EmitJScriptMainFunction, EmitJScriptMain,
2522 * jscript-lexer-parser.g:
2523 - Erased the references to the classes Program, SourceElements,
2524 SourceElement, Statement, FunctionDeclaration and erased
2525 print_statement rule.
2527 * JSCriptLexer.cs JScriptParser.cs and the other files generated
2528 by antlr, reflect changes from the grammar changes.
2530 2003-04-19 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2531 * Added stubs for the classes:
2534 ActiveXObjectConstructor.cs
2538 AssemblyCustomAttributeList.cs
2543 BooleanConstructor.cs
2551 EnumeratorConstructor.cs
2557 FunctionConstructor.cs
2558 FunctionDeclaration.cs
2559 FunctionExpression.cs
2563 IActivationObject.cs
2569 JSFunctionAttribute.cs
2570 JSFunctionAttributeEnum.cs
2575 LenientGlobalObject.cs
2577 NumberConstructor.cs
2579 ObjectConstructor.cs
2581 RegExpConstructor.cs
2586 StringConstructor.cs
2591 VBArrayConstructor.cs
2596 2003-04-11 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2598 * jscript-lexer-parser.g:
2599 - Added rules for: continue_statement, break_statement,
2600 return_statement, throw statement (all of them do not ensure that
2601 no LineSeparator appears between the keyword on the left and the
2602 identifier, expression or semicolon on the right, that must be fixed).
2603 - Added single line comments rule.
2605 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2607 * jscript-lexer-parser.g: Added syntatic rule for:
2609 - while and for-in subrules of iteration_statement.
2610 - Added array_literal - got tricky - I just could get the simplest rule going :)
2614 2003-04-08 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2616 * jscript-lexer-parser.g:
2617 - Syntatic rule for iteration_statement.
2618 - "do" subrule for it.
2619 - Added ((L_THAN | G_THAN | LE_THAN | GE_THAN | "instanceof" |
2620 "in") relational_expression | ) rule to relational_expression.
2621 -Added function_expression syntatic rule.
2622 - Added STRING_LITERAL to literal rules.
2623 - "Less/Greater or equal than" lexer rule.
2625 2003-04-03 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2627 * jscript-lexer-parser.g: Added switch_statement rule, case_block, case_clauses, case_clause, default_clause, labelled_statement, try_statement, catch_exp, finally_exp.
2629 2003-04-01 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2631 * jscript-lexer-parser.g: Added the grammar rules for: with_statement, object_literal, ( expression ), property_name_and_value_list, property_name and expression.
2634 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2636 * Added a README file. Explains the dependencies and build process.
2638 2003-03-30 Cesar Octavio Lopez Nataren <cesar@ciencias.unam.mx>
2640 * Added this ChangeLog file.
2642 * ast.cs: Added this file. Contains the classes used for building
2643 the EcmaScript 's AST.
2645 * JScript*: These are the files generated by antlr (the parser generator).
2647 * TODOAttribute.cs: Changed the namespace in order to use it freely on Microsoft.JScript.
2649 * driver.cs: Added this file. Contains the compiler entry point. And some Reflection.Emit methods,
2650 that will be moved to other file in the future.
2652 * jscript-lexer-parser.g: The EcmaScript's antlr grammar.