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

Method defineOwnProperty

src/main/java/org/dynjs/runtime/Arguments.java:55–78  ·  view source on GitHub ↗
(ExecutionContext context, String name, PropertyDescriptor desc, boolean shouldThrow)

Source from the content-addressed store, hash-verified

53 }
54
55 @Override
56 public boolean defineOwnProperty(ExecutionContext context, String name, PropertyDescriptor desc, boolean shouldThrow) {
57 // 10.6 [[DefineOwnProperty]]
58 boolean allowed = super.defineOwnProperty(context, name, desc, false);
59 if (!allowed) {
60 return reject(context, shouldThrow);
61 }
62
63 if (this.map.getOwnProperty(context, name) != Types.UNDEFINED) {
64 if (desc.isAccessorDescriptor()) {
65 this.map.delete(context, name, false);
66 } else {
67 if (desc.hasValue()) {
68 this.map.put(context, name, desc.getValue(), shouldThrow);
69 }
70 if (desc.hasWritable() && !desc.isWritable()) {
71 this.map.delete(context, name, false);
72 }
73 }
74
75 }
76
77 return true;
78 }
79
80 @Override
81 public boolean delete(ExecutionContext context, String name, boolean shouldThrow) {

Callers 1

createArgumentsObjectMethod · 0.95

Calls 10

rejectMethod · 0.80
isAccessorDescriptorMethod · 0.80
hasValueMethod · 0.80
hasWritableMethod · 0.80
isWritableMethod · 0.80
defineOwnPropertyMethod · 0.65
getOwnPropertyMethod · 0.65
deleteMethod · 0.65
putMethod · 0.65
getValueMethod · 0.45

Tested by

no test coverage detected