react-jsbox
Advanced tools
Comparing version 0.0.53-beta to 0.0.54-beta
{ | ||
"name": "react-jsbox", | ||
"version": "0.0.53-beta", | ||
"version": "0.0.54-beta", | ||
"description": "A Custom React Renderer for writing JSBox apps in React.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,3 +0,1 @@ | ||
const DEBUG = !!global.__REACT_JSBOX_DEBUG__ | ||
export const emptyFunction = () => { } | ||
@@ -42,35 +40,1 @@ | ||
} | ||
export function debug(target, name, descriptor) { | ||
if (!DEBUG) return | ||
if (descriptor.value) { | ||
const original = descriptor.value.bind(target) | ||
descriptor.value = (...args) => { | ||
const val = original(...args) | ||
console.log({ | ||
debug: `call ${name}`, | ||
args: [...args], | ||
return: val | ||
}) | ||
} | ||
return val | ||
} | ||
if (descriptor.get) { | ||
const originalGet = descriptor.get.bind(target) | ||
descriptor.get = () => { | ||
const val = originalGet() | ||
console.log(`debug: get ${name} - ${val}`) | ||
return val | ||
} | ||
} | ||
if (descriptor.set) { | ||
const originalSet = descriptor.set.bind(target) | ||
descriptor.set = val => { | ||
const r = originalSet(val) | ||
console.log(`debug: set ${name} - ${val}`) | ||
return r | ||
} | ||
} | ||
return descriptor | ||
} |
@@ -78,6 +78,6 @@ import View from './Components/view' | ||
@debug | ||
appendChildToContainer(parentInstance, child) { | ||
const parent = parentInstance.element || parentInstance | ||
switch (parent.ocValue().__clsName) { | ||
console.log("appendChildToContainer: ", parent) | ||
switch (parent.ocValue().__clsName) { | ||
case "BBStackView": | ||
@@ -101,3 +101,2 @@ parent.stack.insert(child.element, parent.stack.views.length) | ||
@debug | ||
insertBefore(parentInstance, child, beforeChild) { | ||
@@ -107,3 +106,2 @@ parentInstance.insertBefore(child, beforeChild) | ||
@debug | ||
insertInContainerBefore(parentInstance, child, beforeChild) { | ||
@@ -118,3 +116,2 @@ const parent = parentInstance.element || parentInstance | ||
@debug | ||
removeChildFromContainer(parentInstance, child) { | ||
@@ -121,0 +118,0 @@ const parent = parentInstance.element || parentInstance |
Sorry, the diff of this file is too big to display
105077
727