MCPcopy Create free account
hub / github.com/dynjs/dynjs / delete

Method delete

src/main/java/org/dynjs/runtime/DynObject.java:252–275  ·  view source on GitHub ↗
(ExecutionContext context, String name, boolean shouldThrow)

Source from the content-addressed store, hash-verified

250 }
251
252 @Override
253 public boolean delete(ExecutionContext context, String name, boolean shouldThrow) {
254 // 8.12.7
255 if (!this.properties.containsKey(name)) {
256 return true;
257 }
258 Object d = getOwnProperty(context, name, false);
259 if (d == Types.UNDEFINED) {
260 return true;
261 }
262
263 PropertyDescriptor desc = (PropertyDescriptor) d;
264
265 if (desc.isConfigurable()) {
266 this.properties.remove(name);
267 return true;
268 }
269
270 if (shouldThrow) {
271 throw new ThrowException(context, context.createTypeError("cannot delete unconfigurable property '" + name + "'"));
272 }
273
274 return false;
275 }
276
277 @Override
278 public Object defaultValue(ExecutionContext context, String hint) {

Callers 1

removeMethod · 0.95

Calls 5

getOwnPropertyMethod · 0.95
isConfigurableMethod · 0.95
containsKeyMethod · 0.80
createTypeErrorMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected