MCPcopy
hub / github.com/NaiboWang/EasySpider / set

Function set

ElectronJS/src/taskGrid/vue.js:1080–1109  ·  view source on GitHub ↗

* Set a property on an object. Adds the new property and * triggers change notification if the property doesn't * already exist.

(target, key, val)

Source from the content-addressed store, hash-verified

1078 * already exist.
1079 */
1080 function set (target, key, val) {
1081 if (isUndef(target) || isPrimitive(target)
1082 ) {
1083 warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
1084 }
1085 if (Array.isArray(target) && isValidArrayIndex(key)) {
1086 target.length = Math.max(target.length, key);
1087 target.splice(key, 1, val);
1088 return val
1089 }
1090 if (key in target && !(key in Object.prototype)) {
1091 target[key] = val;
1092 return val
1093 }
1094 var ob = (target).__ob__;
1095 if (target._isVue || (ob && ob.vmCount)) {
1096 warn(
1097 'Avoid adding reactive properties to a Vue instance or its root $data ' +
1098 'at runtime - declare it upfront in the data option.'
1099 );
1100 return val
1101 }
1102 if (!ob) {
1103 target[key] = val;
1104 return val
1105 }
1106 defineReactive$$1(ob.value, key, val);
1107 ob.dep.notify();
1108 return val
1109 }
1110
1111 /**
1112 * Delete a property and trigger change if necessary.

Callers 6

mergeDataFunction · 0.70
mainFunction · 0.50
rename_downloaded_fileFunction · 0.50
_recursive_childrenFunction · 0.50
ChromeClass · 0.50
find_chrome_executableFunction · 0.50

Calls 5

isUndefFunction · 0.85
isPrimitiveFunction · 0.85
isValidArrayIndexFunction · 0.85
defineReactive$$1Function · 0.85
warnFunction · 0.70

Tested by

no test coverage detected