Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES5-Test262 progress #39

Draft
wants to merge 111 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
2164382
Test262 chapter07
anba Mar 21, 2012
6267a13
Test262 chapter08
anba Mar 21, 2012
1366936
Test262 - chapter11
anba Mar 21, 2012
523631c
Test262 - chapter 11: Missing update for Codegen
anba Mar 21, 2012
2f947b9
Test262 - chapter 15
anba Mar 21, 2012
7e3b656
Add PropertyDescriptor class and initial implementations for [8.12] "…
anba Mar 21, 2012
d196372
switch to new [[DefineProperty]] implementation in ScriptableObject
anba Mar 21, 2012
1cadfdd
Implement custom [[DefineProperty]] for IdScriptableObject
anba Mar 21, 2012
8ef010f
Implement custom [[DefineProperty]] for NativeArray
anba Mar 21, 2012
63043a7
Implement custom [[GetOwnProperty]] and [[DefineOwnProperty]] for Nat…
anba Mar 21, 2012
0208e12
Add [[Get]], [[Delete]], [[DefineOwnProperty]] and [[GetOwnProperty]]…
anba Mar 21, 2012
e5baec3
Update BoundFunction to new [[DefineOwnProperty]] API
anba Mar 21, 2012
96b9430
Update NativeObject to new [[DefineOwnProperty]] API
anba Mar 21, 2012
7d1140c
RegExp.prototype.lastIndex can change 'writable' attribute
anba Mar 21, 2012
d0e907c
Fixed braino when checking descriptor's present attributes; Account f…
anba Mar 21, 2012
2292aea
Use different method to plug values from descriptor
anba Mar 21, 2012
e2c96b4
Ensure 'value' for getter-slot is 'undefined'; Make 'isNew' flag only…
anba Mar 21, 2012
4b1f19c
Handle 'arguments' property on BaseFunction more correctly
anba Mar 21, 2012
17d0945
Remove unused feature
anba Mar 21, 2012
d17fa34
Add specialized PropertyDescriptor for slots
anba Mar 21, 2012
fce0efd
remove previous ES5 property descriptor implementation
anba Mar 21, 2012
e8e881a
Avoid ConsString allocation if one of the operands is empty
anba Mar 21, 2012
e9af62a
didn't pay attention to left-right order flag
anba Mar 21, 2012
b262db4
set[UTC]XXX() methods may not evaluate all arguments; fix for ch15/15…
anba Mar 21, 2012
2846575
add missing 'throw' statement
anba Mar 21, 2012
199d1db
Fix ch11/11.2/11.2.3 test cases: arguments are evaluated before check…
anba Mar 21, 2012
1f1b7de
S9.1_A1_T3, S9.8_A5_T2: '+' operator calls first ToPrimitive() then T…
anba Mar 21, 2012
a9d8612
Identifier names no longer need to be quoted in object literals, ther…
anba Mar 21, 2012
3d74c28
add new token type for strict-mode reserved identifiers
anba Mar 21, 2012
298f4b1
Print negative years always in extended mode for toISOString
anba Mar 21, 2012
c37a6d0
strict-mode function name and function parameter checks need to happe…
anba Mar 21, 2012
f13eb27
Pass strict-mode flag to InterpreterData for functions as well
anba Mar 21, 2012
1699f9a
Pass strict-flag from interpreter to parser for direct eval
anba Mar 21, 2012
b39e95e
Also check variables for reserved names in strict-mode
anba Mar 21, 2012
1beedf5
account for RESERVED -> NAME change in TokenStream
anba Mar 21, 2012
acad1fd
re-sync date methods with jsdate.cpp
anba Mar 21, 2012
c42394c
Add missing entry for STRICT_SETNAME; Move YIELD to proper position p…
anba Mar 21, 2012
20c2430
No longer necessary to restrict strict-mode check to AstRoot
anba Mar 21, 2012
c9515c7
Add new token-types for strict [[Put]] operations similar to STRICT_S…
anba Mar 21, 2012
6ff3146
Handle STRICT_SET{PROP,ELEM} in interpreter
anba Mar 21, 2012
7a18e00
Initial commit for strict assignment work
anba Mar 21, 2012
6149ac5
Add static [[Put]] method with 'throw'-flag per ES5 to ScriptableObje…
anba Mar 21, 2012
9f6b535
API-Update: Add 'throw' flag from 8.12.5 [[Put]] to Scriptable#put(...)
anba Mar 21, 2012
6edf942
Add missing @Deprecated and @Override annotations
anba Mar 21, 2012
338154a
Check throw-flag in [[Put]] to emit TypeError in strict-mode
anba Mar 21, 2012
181909e
initialize strict-mode properly for AstRoot and FunctionNode
anba Mar 21, 2012
cf7cbc6
Use the right object to check strict-mode settings
anba Mar 21, 2012
f41e7e1
strict eval uses a new variable environment
anba Mar 21, 2012
b4b6d70
Change more 'thisObject' definitions from Scriptable to Object
anba Mar 21, 2012
6da44f3
re-enable non-standard regexp flag for String.prototype.replace
anba Mar 21, 2012
ee09dab
Update caller initScript() to adjust to changed argument types
anba Mar 21, 2012
1b28d5d
'eval' and 'arguments' must not be LHS operand for assignment resp. m…
anba Mar 21, 2012
b1d0421
String.prototype.replace calls function with 'this' = 'undefined
anba Mar 21, 2012
796fa2b
Function.prototype.bind uses supplied thisArg as-is, no coercing is t…
anba Mar 21, 2012
d9c1d49
Ensure FunctionObject#call() coerces thisObject to Scriptable
anba Mar 21, 2012
d3679df
Add method to query function's strictness to NativeFunction; Add stri…
anba Mar 21, 2012
1852357
API-Change: Scriptable#delete(String|int) -> Scriptable#delete(String…
anba Mar 21, 2012
6bede2d
11.4.1 The delete Operator: SyntaxError is thrown operand is name
anba Mar 21, 2012
c48a2a8
Invalid lhs in assignment throws ReferenceError as early error per ch…
anba Mar 21, 2012
cf64db0
Bring extended precision back again for Number.prototype.{toFixed,toP…
anba Mar 21, 2012
1d33469
Add non-configurable checks to NativeString and ScriptableObject and …
anba Mar 21, 2012
52054da
Implement strict-mode restriction w.r.t to 'arguments' and 'caller' f…
anba Mar 21, 2012
a76c103
Use correct 'thisObject' for Array.prototype.{search,every,filter,som…
anba Mar 21, 2012
2cb53d6
override construct() in IdFunctionObject to enable code like Number.c…
anba Mar 21, 2012
0fb8cd9
Set-up proto and parent-scope for TypeErrorThrower function; Remove a…
anba Mar 21, 2012
4a57ccc
Array.prototype.toLocaleString changed to follow spec/spidermonkey mo…
anba Mar 21, 2012
0509ae4
RefCallable also needs to handle non-Scriptable thisObject
anba Mar 21, 2012
77f97a3
Use 'null' as marker to use 'undefined' to thisObj; Set callThis to '…
anba Mar 21, 2012
6df69e0
Test262 complete Interpreter, but still needs some tweaks
anba Mar 21, 2012
d8a0b09
Test262 complete Codegen, but still needs some tweaks
anba Mar 21, 2012
7026596
- process inc/dec with proper strict-mode setting in Interpreter
anba Mar 21, 2012
f5329f6
- support special GetValue and PutValue on primitives in call express…
anba Mar 21, 2012
33ab68c
prepare optimization for GetValue/PutValue on primitives
anba Mar 21, 2012
e51dbbe
add PropertyDescriptor#toString()
anba Mar 21, 2012
3f38ce0
Add cache for parameter size; Increase initial size for the various c…
anba Mar 21, 2012
88571d3
Use Java1.4 Throwable API to obtain stacktrace information instead of…
anba Mar 21, 2012
1e7d7dd
Add helper methods for faster element access on primitives
anba Mar 21, 2012
6f4f27d
Improved [[Get]] operations for primitives
anba Mar 21, 2012
4f5727e
Final change to use optimized [[Get]] for primitives
anba Mar 21, 2012
37fdb86
Add missing error messages; use reportError() instead of addError() f…
anba Mar 21, 2012
fac37c4
Fix bugs in octal escape sequences for regular expressions and make t…
anba Mar 21, 2012
381a22c
Add missing check for invalid 'arguments' as lhs in assignment (stric…
anba Mar 21, 2012
f441726
Fix bugs in octal escape sequences for regular expressions and make t…
anba Mar 21, 2012
86a2751
Make direct eval detection spec-compliant
anba Mar 21, 2012
bfb33d5
Functions created through the built-in Function constructor do not in…
anba Mar 21, 2012
363a0fa
'new Object' also performs ToObject conversion if called with a non-n…
anba Mar 21, 2012
78f3296
Don't create array object for Array.prototype.{every,some,forEach}
anba Mar 21, 2012
3a56086
Make ScriptRuntime.init{Script,Function}() match 10.5 [Declaration Bi…
anba Mar 21, 2012
aa33ccf
Add internal method to circumvent [[Extensible]] check when setting l…
anba Mar 21, 2012
1cbab8d
Make sure storeThis() is always the last operation before 'return' to…
anba Mar 21, 2012
bfd4bb9
Avoid adding new own 'name' property for error objects if not necessa…
anba Mar 21, 2012
7870a8d
Refine redefineProperty() rules to match Spidermonkey more closely [S…
anba Mar 21, 2012
e36cd25
Just a note to self
anba Mar 21, 2012
8db4656
Remove __parent__ special property (https://bugzilla.mozilla.org/show…
anba Mar 21, 2012
46c8489
Disallow E4X syntax in ES5 strict mode (https://bugzilla.mozilla.org/…
anba Mar 21, 2012
fa7b305
Added JavaDoc and more supplemental comments; Marked methods as final…
anba Mar 21, 2012
0e7241e
Added documentation and fixed two brain-ohs in {define,update}OwnProp…
anba Mar 21, 2012
b8c0387
Remove defineProperty() with integer index from ScriptableObject sinc…
anba Mar 21, 2012
aa3545d
Remove duplicate code from Context; Use newBuiltinObject() instead of…
anba Mar 21, 2012
22562ef
Add cache for native error objects to the TopLevel class for the very…
anba Mar 21, 2012
118a44a
arguments object should not have its own 'constructor' property, inst…
anba Mar 21, 2012
e1add70
Fix 10.5 Binding Instantiation according to ES5.1 errata (https://bug…
anba Mar 21, 2012
7037e8d
Restructure SpecialRef to use OOP and improve handling for own '__pro…
anba Mar 21, 2012
c6dc96a
Add strict-mode support to SpecialRef
anba Mar 21, 2012
98b5329
Don't clobber 'this' value in SpecialRef -> consider setter/getter pr…
anba Mar 21, 2012
d0a51fe
Reuse TopLevel.NativeErrors enum for native error names
anba Mar 21, 2012
f265ab0
Add 'throw' flag to ConstProperties just like in Scriptable to contro…
anba Mar 21, 2012
a06e513
Next update for strict-mode compatible const properties
anba Mar 21, 2012
d24bdd1
Add strict-mode checks to ScriptableObject#putConstImpl()
anba Mar 21, 2012
9ce9228
Add missing error messages
anba Mar 21, 2012
638d09d
IRFactory: no longer treat 'eval' in Token.GETPROP as Token.SPECIALCA…
anba Mar 21, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
* @deprecated The exception is no longer thrown by Rhino runtime as
* {@link EvaluatorException} is used instead.
*/
@Deprecated
public class ClassDefinitionException extends RuntimeException
{
static final long serialVersionUID = -5637830967241712746L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
* @deprecated The exception is no longer thrown by Rhino runtime as
* {@link EvaluatorException} is used instead.
*/
@Deprecated
public class NotAFunctionException extends RuntimeException
{
static final long serialVersionUID = 6461524852170711724L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
/**
* @deprecated This exception is no longer thrown by Rhino runtime.
*/
@Deprecated
public class PropertyException extends RuntimeException
{
static final long serialVersionUID = -8221564865490676219L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,19 @@ else if (xmlOne.isStart())
private static boolean attributeListsEqual(XmlCursor xmlOne, XmlCursor xmlTwo)
{
boolean result = true;
TreeMap mapOne = loadAttributeMap(xmlOne);
TreeMap mapTwo = loadAttributeMap(xmlTwo);
TreeMap<?, ?> mapOne = loadAttributeMap(xmlOne);
TreeMap<?, ?> mapTwo = loadAttributeMap(xmlTwo);

if (mapOne.size() != mapTwo.size())
{
result = false;
}
else
{
Set keysOne = mapOne.keySet();
Set keysTwo = mapTwo.keySet();
Iterator itOne = keysOne.iterator();
Iterator itTwo = keysTwo.iterator();
Set<?> keysOne = mapOne.keySet();
Set<?> keysTwo = mapTwo.keySet();
Iterator<?> itOne = keysOne.iterator();
Iterator<?> itTwo = keysTwo.iterator();

while (result && itOne.hasNext())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public String prefix()
*
* @return
*/
@Override
public String toString ()
{
return uri();
Expand All @@ -129,17 +130,20 @@ public String toLocaleString ()
return toString();
}

@Override
public boolean equals(Object obj)
{
if (!(obj instanceof Namespace)) return false;
return equals((Namespace)obj);
}

@Override
public int hashCode()
{
return uri().hashCode();
}

@Override
protected Object equivalentValues(Object value)
{
if (!(value instanceof Namespace)) return Scriptable.NOT_FOUND;
Expand All @@ -156,6 +160,7 @@ private boolean equals(Namespace n)
*
* @return
*/
@Override
public String getClassName ()
{
return "Namespace";
Expand All @@ -166,6 +171,7 @@ public String getClassName ()
* @param hint
* @return
*/
@Override
public Object getDefaultValue (Class hint)
{
return uri();
Expand All @@ -177,11 +183,13 @@ public Object getDefaultValue (Class hint)
Id_uri = 2,
MAX_INSTANCE_ID = 2;

@Override
protected int getMaxInstanceId()
{
return super.getMaxInstanceId() + MAX_INSTANCE_ID;
}

@Override
protected int findInstanceIdInfo(String s)
{
int id;
Expand All @@ -208,6 +216,7 @@ protected int findInstanceIdInfo(String s)
}
// #/string_id_map#

@Override
protected String getInstanceIdName(int id)
{
switch (id - super.getMaxInstanceId()) {
Expand All @@ -217,6 +226,7 @@ protected String getInstanceIdName(int id)
return super.getInstanceIdName(id);
}

@Override
protected Object getInstanceIdValue(int id)
{
switch (id - super.getMaxInstanceId()) {
Expand All @@ -237,6 +247,7 @@ protected Object getInstanceIdValue(int id)
Id_toSource = 3,
MAX_PROTOTYPE_ID = 3;

@Override
protected int findPrototypeId(String s)
{
int id;
Expand All @@ -256,6 +267,7 @@ protected int findPrototypeId(String s)
}
// #/string_id_map#

@Override
protected void initPrototypeId(int id)
{
String s;
Expand All @@ -269,10 +281,11 @@ protected void initPrototypeId(int id)
initPrototypeMethod(NAMESPACE_TAG, id, s, arity);
}

@Override
public Object execIdCall(IdFunctionObject f,
Context cx,
Scriptable scope,
Scriptable thisObj,
Object thisObj,
Object[] args)
{
if (!f.hasTag(NAMESPACE_TAG)) {
Expand All @@ -290,7 +303,7 @@ public Object execIdCall(IdFunctionObject f,
throw new IllegalArgumentException(String.valueOf(id));
}

private Namespace realThis(Scriptable thisObj, IdFunctionObject f)
private Namespace realThis(Object thisObj, IdFunctionObject f)
{
if(!(thisObj instanceof Namespace))
throw incompatibleCallError(f);
Expand Down
17 changes: 15 additions & 2 deletions deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/QName.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ void exportAsJSClass(boolean sealed)
*
* @return
*/
@Override
public String toString()
{
String result;
Expand Down Expand Up @@ -111,17 +112,20 @@ String uri()
return uri;
}

@Override
public boolean equals(Object obj)
{
if(!(obj instanceof QName)) return false;
return equals((QName)obj);
}

@Override
public int hashCode()
{
return localName.hashCode() ^ (uri == null ? 0 : uri.hashCode());
}

@Override
protected Object equivalentValues(Object value)
{
if(!(value instanceof QName)) return Scriptable.NOT_FOUND;
Expand All @@ -146,6 +150,7 @@ private boolean equals(QName q)
*
* @return
*/
@Override
public String getClassName ()
{
return "QName";
Expand All @@ -156,6 +161,7 @@ public String getClassName ()
* @param hint
* @return
*/
@Override
public Object getDefaultValue (Class hint)
{
return toString();
Expand All @@ -167,11 +173,13 @@ public Object getDefaultValue (Class hint)
Id_uri = 2,
MAX_INSTANCE_ID = 2;

@Override
protected int getMaxInstanceId()
{
return super.getMaxInstanceId() + MAX_INSTANCE_ID;
}

@Override
protected int findInstanceIdInfo(String s)
{
int id;
Expand All @@ -198,6 +206,7 @@ protected int findInstanceIdInfo(String s)
}
// #/string_id_map#

@Override
protected String getInstanceIdName(int id)
{
switch (id - super.getMaxInstanceId()) {
Expand All @@ -207,6 +216,7 @@ protected String getInstanceIdName(int id)
return super.getInstanceIdName(id);
}

@Override
protected Object getInstanceIdValue(int id)
{
switch (id - super.getMaxInstanceId()) {
Expand All @@ -223,6 +233,7 @@ protected Object getInstanceIdValue(int id)
Id_toSource = 3,
MAX_PROTOTYPE_ID = 3;

@Override
protected int findPrototypeId(String s)
{
int id;
Expand All @@ -242,6 +253,7 @@ protected int findPrototypeId(String s)
}
// #/string_id_map#

@Override
protected void initPrototypeId(int id)
{
String s;
Expand All @@ -255,10 +267,11 @@ protected void initPrototypeId(int id)
initPrototypeMethod(QNAME_TAG, id, s, arity);
}

@Override
public Object execIdCall(IdFunctionObject f,
Context cx,
Scriptable scope,
Scriptable thisObj,
Object thisObj,
Object[] args)
{
if (!f.hasTag(QNAME_TAG)) {
Expand All @@ -276,7 +289,7 @@ public Object execIdCall(IdFunctionObject f,
throw new IllegalArgumentException(String.valueOf(id));
}

private QName realThis(Scriptable thisObj, IdFunctionObject f)
private QName realThis(Object thisObj, IdFunctionObject f)
{
if(!(thisObj instanceof QName))
throw incompatibleCallError(f);
Expand Down
Loading