Check for null and unwrap EcmaScript object to Java object in putProperty().
Especially the toJavaObject() may break something somewhere, not 100% sure, but we should do this to avoid references from map values to the wrong EcmaScript evaluator.
This commit is contained in:
parent
8a598b3371
commit
f3371c79f1
1 changed files with 4 additions and 2 deletions
|
@ -48,8 +48,10 @@ public class ESMapWrapper extends ESWrapper {
|
|||
public void putProperty(String propertyName, ESValue propertyValue, int hash) throws EcmaScriptException {
|
||||
if (data == null)
|
||||
data = new HashMap ();
|
||||
if (readonly==false)
|
||||
data.put (propertyName, propertyValue);
|
||||
if (propertyValue == ESNull.theNull)
|
||||
deleteProperty(propertyName, hash);
|
||||
else if (readonly==false)
|
||||
data.put (propertyName, propertyValue.toJavaObject ());
|
||||
else
|
||||
throw new EcmaScriptException ("object is readonly");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue