jswrap_object.h 1.2 KB

123456789101112131415161718192021222324252627
  1. /*
  2. * This file is part of Espruino, a JavaScript interpreter for Microcontrollers
  3. *
  4. * Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
  5. *
  6. * This Source Code Form is subject to the terms of the Mozilla Public
  7. * License, v. 2.0. If a copy of the MPL was not distributed with this
  8. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  9. *
  10. * ----------------------------------------------------------------------------
  11. * JavaScript methods for Objects and Functions
  12. * ----------------------------------------------------------------------------
  13. */
  14. #include "jsvar.h"
  15. JsVar *jswrap_object_length(JsVar *parent);
  16. JsVar *jswrap_object_toString(JsVar *parent, JsVar *arg0);
  17. JsVar *jswrap_object_clone(JsVar *parent);
  18. JsVar *jswrap_object_keys(JsVar *obj);
  19. void jswrap_object_on(JsVar *parent, JsVar *event, JsVar *listener);
  20. void jswrap_object_emit(JsVar *parent, JsVar *event, JsVar *v1, JsVar *v2);
  21. void jswrap_object_removeAllListeners(JsVar *parent, JsVar *event);
  22. void jswrap_function_replaceWith(JsVar *parent, JsVar *newFunc);
  23. JsVar *jswrap_function_call(JsVar *parent, JsVar *thisArg, JsVar *a, JsVar *b, JsVar *c, JsVar *d);
  24. JsVar *jswrap_function_apply(JsVar *parent, JsVar *thisArg, JsVar *argsArray);