(name unistring.String, val Value, throw bool)
| 124 | } |
| 125 | |
| 126 | func (o *objectGoMapReflect) setOwnStr(name unistring.String, val Value, throw bool) bool { |
| 127 | n := name.String() |
| 128 | key := o.strToKey(n, false) |
| 129 | if !key.IsValid() || !o.fieldsValue.MapIndex(key).IsValid() { |
| 130 | if proto := o.prototype; proto != nil { |
| 131 | // we know it's foreign because prototype loops are not allowed |
| 132 | if res, ok := proto.self.setForeignStr(name, val, o.val, throw); ok { |
| 133 | return res |
| 134 | } |
| 135 | } |
| 136 | // new property |
| 137 | if !o.extensible { |
| 138 | o.val.runtime.typeErrorResult(throw, "Cannot add property %s, object is not extensible", n) |
| 139 | return false |
| 140 | } else { |
| 141 | if throw && !key.IsValid() { |
| 142 | o.strToKey(n, true) |
| 143 | return false |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | o._put(key, val, throw) |
| 148 | return true |
| 149 | } |
| 150 | |
| 151 | func (o *objectGoMapReflect) setOwnIdx(idx valueInt, val Value, throw bool) bool { |
| 152 | key := o.toKey(idx, false) |
nothing calls this directly
no test coverage detected