changed: test019.42.js because Integer.parseInt is moved
in r70 to the global scope.
with the next commit the Integer-object will be
completely removed from 42tiny-js.
"Integer.valueOf" can no longer be used.
Uses "String.charCodeAt" instead.
- added Lexer can now detect regular expression literals
but using of regular expression are currently unsupported
- added function closure test "tests/42tests/test002.js"
many many changes. Too many to enumerate them here.
New main-features:
- injected a tokenizer between Lexer and Executer.
this makes the two-pass-mode obsolete. the first pass is done by the tokenizer.
- add 'with' and 'let' statements.
- fixed and optimized the prototype- and scope-chain
- added accessors like: { get test(){ return this.test_var; } , test_var : 5 }
- and many more
i wish you a happy new year 2012
ardi
42tiny-js is partially more JavaScript compliant as the trunk-tiny-js
e.g.: trunk-tiny-js creates a var always when its needed but 42tiny-js only if the var the left-hand-side of an assignment-operator.
Test-scripts:
Some test-scripts in the "tests"-folder are not JavaScript compliant.
I have add new scripts according to the schematic: name.js -> name.42.js
run_tests:
run_tests is changed to prefer the ???.42.js files. Also run_tests is changed to run scripts in the "tests/42tests" folder after finished the tests from the "tests"-folder.
statements and then only return the value from the last one.
Also checks to make sure *everything* was parsed.
Ints + doubles are now stored in binary form (faster + more precise)
sprintf -> sprintf_s
extra tokens parsed
array memory leak fixed
Fixed memory leak in evaluateComplex
Fixed memory leak in FOR loops
Fixed memory leak for unary minus
Version 0.21 : Added array type
String.length() no more - now String.length
Added extra constructors to reduce confusion
Fixed checks against undefined
Added JSON.stringify and eval()
Nicer JSON indenting
Fixed function output in JSON
Added evaluateComplex
Fixed some reentrancy issues with evaluate/execute
symbol_base removed and replaced with 'scopes' stack
Added reference counting a proper tree structure
(Allowing pass by reference)
Allowed JSON output to output IDs, not strings
Added get/set for array indices
Changed Callbacks to include user data pointer
Added some support for objects
Added more Java-esque builtin functions
Added parsing of string defined with '
Changed nil to null as per spec, added 'undefined'
Now set variables with the correct scope, and treat unknown
as 'undefined' rather than failing
Added proper (I hope) handling of null and undefined
Added === check
Ability to define functions without names
Can now do "var mine = function(a,b) { ... };"
Slightly better 'trace' function
Added findChildOrCreateByPath function
Added simple test suite
Added skipping of blocks when not executing
root variable now doesn't change (as you'd expect)
a few built-in functions
The lexer can now work on a substring, which means no more string copies for loops/functions