|
@@ -18,7 +18,15 @@ func (a *argumentsObject) getStr(name unistring.String, receiver Value) Value {
|
|
|
|
|
|
func (a *argumentsObject) getOwnPropStr(name unistring.String) Value {
|
|
|
if mapped, ok := a.values[name].(*mappedProperty); ok {
|
|
|
- return *mapped.v
|
|
|
+ if mapped.writable && mapped.enumerable && mapped.configurable {
|
|
|
+ return *mapped.v
|
|
|
+ }
|
|
|
+ return &valueProperty{
|
|
|
+ value: *mapped.v,
|
|
|
+ writable: mapped.writable,
|
|
|
+ configurable: mapped.configurable,
|
|
|
+ enumerable: mapped.enumerable,
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return a.baseObject.getOwnPropStr(name)
|
|
@@ -45,18 +53,6 @@ func (a *argumentsObject) setForeignStr(name unistring.String, val, receiver Val
|
|
|
return a._setForeignStr(name, a.getOwnPropStr(name), val, receiver, throw)
|
|
|
}
|
|
|
|
|
|
-/*func (a *argumentsObject) putStr(name string, val Value, throw bool) {
|
|
|
- if prop, ok := a.values[name].(*mappedProperty); ok {
|
|
|
- if !prop.writable {
|
|
|
- a.val.runtime.typeErrorResult(throw, "Property is not writable: %s", name)
|
|
|
- return
|
|
|
- }
|
|
|
- *prop.v = val
|
|
|
- return
|
|
|
- }
|
|
|
- a.baseObject.putStr(name, val, throw)
|
|
|
-}*/
|
|
|
-
|
|
|
func (a *argumentsObject) deleteStr(name unistring.String, throw bool) bool {
|
|
|
if prop, ok := a.values[name].(*mappedProperty); ok {
|
|
|
if !a.checkDeleteProp(name, &prop.valueProperty, throw) {
|