Skip to content

Commit bcfc268

Browse files
committed
and, not or
1 parent 826c7ef commit bcfc268

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/compiler/jsexecute.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -629,31 +629,31 @@ runtimeFunctions._resolveKeyPath = `const _resolveKeyPath = (obj, keyPath) => {
629629

630630
runtimeFunctions.get = `const get = (obj, keyPath) => {
631631
const [root, key] = _resolveKeyPath(obj, keyPath);
632-
if ((Object.getPrototypeOf(root) !== Object || Object.getPrototypeOf(root) !== null) && typeof root.get !== 'function') return '';
632+
if ((Object.getPrototypeOf(root) !== Object && Object.getPrototypeOf(root) !== null) && typeof root.get !== 'function') return '';
633633
return typeof root === 'undefined'
634634
? ''
635635
: root.get?.(key) ?? root[key];
636636
}`;
637637

638638
runtimeFunctions.set = `const set = (obj, keyPath, val) => {
639639
const [root, key] = _resolveKeyPath(obj, keyPath);
640-
if ((Object.getPrototypeOf(root) !== Object || Object.getPrototypeOf(root) !== null) && typeof root.set !== 'function') return '';
640+
if ((Object.getPrototypeOf(root) !== Object && Object.getPrototypeOf(root) !== null) && typeof root.set !== 'function') return '';
641641
return typeof root === 'undefined'
642642
? ''
643643
: root.set?.(key, val) ?? (root[key] = val);
644644
}`;
645645

646646
runtimeFunctions.remove = `const remove = (obj, keyPath) => {
647647
const [root, key] = _resolveKeyPath(obj, keyPath);
648-
if ((Object.getPrototypeOf(root) !== Object || Object.getPrototypeOf(root) !== null) && typeof root.remove !== 'function' && typeof root.delete !== 'function') return '';
648+
if ((Object.getPrototypeOf(root) !== Object && Object.getPrototypeOf(root) !== null) && typeof root.remove !== 'function' && typeof root.delete !== 'function') return '';
649649
return typeof root === 'undefined'
650650
? ''
651651
: root.delete?.(key) ?? root.remove?.(key) ?? (delete root[key]);
652652
}`;
653653

654654
runtimeFunctions.includes = `const includes = (obj, keyPath) => {
655655
const [root, key] = _resolveKeyPath(obj, keyPath);
656-
if ((Object.getPrototypeOf(root) !== Object || Object.getPrototypeOf(root) !== null) && typeof root.has !== 'function') return '';
656+
if ((Object.getPrototypeOf(root) !== Object && Object.getPrototypeOf(root) !== null) && typeof root.has !== 'function') return '';
657657
return typeof root === 'undefined'
658658
? ''
659659
: root.has?.(key) ?? (key in root);

0 commit comments

Comments
 (0)