( js: NodeCompiler, target: string, key: Key, value: string, isPlain = false )
| 1772 | // assigning "__proto__" or an inherited accessor/read-only property invokes |
| 1773 | // prototype setters or throws instead of defining an own key |
| 1774 | const jsSetOwnProp = ( |
| 1775 | js: NodeCompiler, |
| 1776 | target: string, |
| 1777 | key: Key, |
| 1778 | value: string, |
| 1779 | isPlain = false |
| 1780 | ): string => |
| 1781 | key === "__proto__" ? |
| 1782 | `Object.defineProperty(${target}, "__proto__", { value: ${value}, writable: true, enumerable: true, configurable: true })` |
| 1783 | : key in Object.prototype ? |
| 1784 | `${js.ref(setOwnValue)}(${target}, ${js.serialize(key)}, ${value})` |
| 1785 | : isPlain ? `${target}${js.prop(key)} = ${value}` |
| 1786 | : `Object.getPrototypeOf(${target}) === Object.prototype ? (${target}${js.prop(key)} = ${value}) : ${js.ref(setOwnValue)}(${target}, ${js.serialize(key)}, ${value})` |
| 1787 | |
| 1788 | export const compileDefault = ( |
| 1789 | js: NodeCompiler, |
no test coverage detected