Hello again here I put the changes in detail
usb_conf.h before [#define](https://forum.espruino.com/search/?q=%23define) IMR_MSK (CNTR_CTRM | CNTR_WKUPM |/* CNTR_SUSPM | CNTR_ERRM | */CNTR_SOFM | /*CNTR_ESOFM |*/ CNTR_RESETM ) After [#define](https://forum.espruino.com/search/?q=%23define) IMR_MSK (CNTR_CTRM | CNTR_WKUPM | CNTR_SUSPM | CNTR_ERRM | CNTR_SOFM | CNTR_ESOFM | CNTR_RESETM )
jswrap_object.c before /*JSON{ "type":"method", "class": "Object", "name" : "hasOwnProperty", "description" : ["Return true if the object (not its prototype) has the given property.","NOTE: This currently returns false-positives for built-in functions in prototypes"], "generate" : "jswrap_object_hasOwnProperty", "params" : [ [ "name", "JsVar", "The name of the property to search for"] ], "return" : ["bool", "True if it exists, false if it doesn't"] }*/ bool jswrap_object_hasOwnProperty(JsVar *parent, JsVar *name) { JsVar *propName = jsvAsArrayIndex(name); bool contains = false; if (jsvHasChildren(parent)) { JsVar *foundVar = jsvFindChildFromVar(parent, propName, false); if (foundVar) { contains = true; jsvUnLock(foundVar); } } if (!contains) { // search builtins char str[32]; jsvGetString(propName, str, sizeof(str)); JsVar *foundVar = jswFindBuiltInFunction(parent, str); if (foundVar) { contains = true; jsvUnLock(foundVar); } } jsvUnLock(propName); return contains; } After /*JSON{ "type":"method", "class": "Object", "name" : "hasOwnProperty", "description" : ["Return true if the object (not its prototype) has the given property.","NOTE: This currently returns false-positives for built-in functions in prototypes"], "generate" : "jswrap_object_hasOwnProperty", "params" : [ [ "name", "JsVar", "The name of the property to search for"] ], "return" : ["bool", "True if it exists, false if it doesn't"] }*/ bool jswrap_object_hasOwnProperty(JsVar *parent, JsVar *name) { char str[32]; jsvGetString(name, str, sizeof(str)); //JsVar *propName = jsvAsArrayIndex(name); bool contains = false; if (jsvHasChildren(parent)) { JsVar *foundVar = jsvFindChildFromVar(parent, str, false); if (foundVar) { contains = true; jsvUnLock(foundVar); } } if (!contains) { // search builtins //jsvGetString(propName, str, sizeof(str)); JsVar *foundVar = jswFindBuiltInFunction(parent, str); if (foundVar) { contains = true; jsvUnLock(foundVar); } } //jsvUnLock(propName); return contains; }
functional today a greeting
@alexrlopez86 started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hello again here I put the changes in detail
functional today
a greeting