(ExecutionContext context, String name)
| 214 | } |
| 215 | |
| 216 | @Override |
| 217 | public boolean canPut(ExecutionContext context, String name) { |
| 218 | // 8.12.4 |
| 219 | Object d = getOwnProperty(context, name, false); |
| 220 | |
| 221 | // Find the property on ourself, or our prototype |
| 222 | if (d == Types.UNDEFINED) { |
| 223 | if (this.prototype != null) { |
| 224 | d = this.prototype.getProperty(context, name, false); |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | // System.err.println("canPut?: " + name + " > " + d); |
| 229 | |
| 230 | // If either has it, deal with descriptor appropriately |
| 231 | if (d != Types.UNDEFINED) { |
| 232 | PropertyDescriptor desc = (PropertyDescriptor) d; |
| 233 | if (desc.isAccessorDescriptor()) { |
| 234 | if (desc.getSetter() == Types.UNDEFINED) { |
| 235 | // System.err.println("NO SET"); |
| 236 | return false; |
| 237 | } |
| 238 | return true; |
| 239 | } else { |
| 240 | // System.err.println("writable? " + writable); |
| 241 | if (!desc.hasWritable()) { |
| 242 | return true; |
| 243 | } |
| 244 | return desc.isWritable(); |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | // Else, just determine if we are extensible directly |
| 249 | return isExtensible(); |
| 250 | } |
| 251 | |
| 252 | @Override |
| 253 | public boolean delete(ExecutionContext context, String name, boolean shouldThrow) { |
no test coverage detected