(str, context, type, value, targetElement)
| 2340 | return val; |
| 2341 | } |
| 2342 | setSymbol(str, context, type, value, targetElement) { |
| 2343 | if (type === "global") { |
| 2344 | this.#globalScope[str] = value; |
| 2345 | this.reactivity.notifyGlobalSymbol(str); |
| 2346 | return; |
| 2347 | } |
| 2348 | if (type === "element") { |
| 2349 | this.#getElementScope(context)[str] = value; |
| 2350 | this.reactivity.notifyElementSymbol(str, context.meta.owner); |
| 2351 | return; |
| 2352 | } |
| 2353 | if (type === "inherited") { |
| 2354 | var inherited = this.#resolveInherited(str, context, targetElement); |
| 2355 | if (inherited.element) { |
| 2356 | this.getInternalData(inherited.element).elementScope[str] = value; |
| 2357 | this.reactivity.notifyElementSymbol(str, inherited.element); |
| 2358 | } else { |
| 2359 | var owner = targetElement || context.meta?.owner; |
| 2360 | if (owner) { |
| 2361 | var internalData = this.getInternalData(owner); |
| 2362 | if (!internalData.elementScope) internalData.elementScope = {}; |
| 2363 | internalData.elementScope[str] = value; |
| 2364 | this.reactivity.notifyElementSymbol(str, owner); |
| 2365 | } |
| 2366 | } |
| 2367 | return; |
| 2368 | } |
| 2369 | if (this.#isHyperscriptContext(context) && !this.#isReservedWord(str) && typeof context.locals[str] !== "undefined") { |
| 2370 | context.locals[str] = value; |
| 2371 | return; |
| 2372 | } |
| 2373 | var elementScope = this.#getElementScope(context); |
| 2374 | if (typeof elementScope[str] !== "undefined") { |
| 2375 | elementScope[str] = value; |
| 2376 | this.reactivity.notifyElementSymbol(str, context.meta.owner); |
| 2377 | } else if (this.#isHyperscriptContext(context) && !this.#isReservedWord(str)) { |
| 2378 | context.locals[str] = value; |
| 2379 | } else { |
| 2380 | context[str] = value; |
| 2381 | } |
| 2382 | } |
| 2383 | getInternalData(elt) { |
| 2384 | if (!elt._hyperscript) { |
| 2385 | elt._hyperscript = {}; |
no test coverage detected