MCPcopy
hub / github.com/fanmingming/live / del

Function del

m3u8/vue.js:1113–1138  ·  view source on GitHub ↗

* Delete a property and trigger change if necessary.

(target, key)

Source from the content-addressed store, hash-verified

1111 * Delete a property and trigger change if necessary.
1112 */
1113 function del (target, key) {
1114 if (isUndef(target) || isPrimitive(target)
1115 ) {
1116 warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
1117 }
1118 if (Array.isArray(target) && isValidArrayIndex(key)) {
1119 target.splice(key, 1);
1120 return
1121 }
1122 var ob = (target).__ob__;
1123 if (target._isVue || (ob && ob.vmCount)) {
1124 warn(
1125 'Avoid deleting properties on a Vue instance or its root $data ' +
1126 '- just set it to null.'
1127 );
1128 return
1129 }
1130 if (!hasOwn(target, key)) {
1131 return
1132 }
1133 delete target[key];
1134 if (!ob) {
1135 return
1136 }
1137 ob.dep.notify();
1138 }
1139
1140 /**
1141 * Collect dependencies on array elements when the array is touched, since

Callers

nothing calls this directly

Calls 5

isUndefFunction · 0.85
isPrimitiveFunction · 0.85
warnFunction · 0.85
isValidArrayIndexFunction · 0.85
hasOwnFunction · 0.85

Tested by

no test coverage detected