Skip to content
Snippets Groups Projects
  1. Apr 04, 2021
  2. Feb 22, 2021
  3. Aug 16, 2020
  4. Apr 20, 2020
  5. May 04, 2019
    • rswindell's avatar
    • rswindell's avatar
      Define and use a wrapper for JS_GetInstancePrivate(): js_GetClassPrivate() · 6f83c4ff
      rswindell authored
      Use this in place of JS_GetPrivate() in native class methods that need the
      class instance's private data pointer and will do bad things if that pointer
      points to something other than what is expected. mcmlxxix (matt) discovered
      that using Object.apply(), you can invoke class methods where the 'this'
      instance is a different class. This would result in
      "Internal Error: No Private Data." or a crash.
      So now, gracefully detect this condition and report a meaningful error:
      "'<class-name>' instance: No Private Data or Class Mismatch"
      
      Also, important to note: if the method uses JS_THIS_OBJECT to get the JSObject*
      to pass to JS_Get*Private, then it must do this *before* it calls JS_SET_RVAL.
      
      From jsapi.h:
       * NB: there is an anti-dependency between JS_CALLEE and JS_SET_RVAL: native
       * methods that may inspect their callee must defer setting their return value
       * until after any such possible inspection. Otherwise the return value will be
       * inspected instead of the callee function object.
      
      The js_crypt*.c files still need this treatment.
      6f83c4ff
  6. Feb 20, 2018
  7. Dec 01, 2016
    • rswindell's avatar
      Error messages logged with errormsg() now contain the name of the C/C++ · b4b6713e
      rswindell authored
      function where the error is being reported from. So the WHERE macro now
      contains the __FUNCTION__ "macro" and the various js*.c files that use the
      WHERE macro to report errors had to be updated too.
      Also, the 'access' argument is now being passed as a signed long rather than
      unsigned long. Status/return values are often passed in here (e.g. from smblib)
      and may be negative. This argument was being displayed with %ld but wasn't
      being passed in as a signed value, so on 64-bit long systems, negative numbers
      were just printed as large (4M+) numbers.
      Also, no need to call getfname() in errormsg() since this is embedded in the
      WHERE macro (since 2009).
      b4b6713e
  8. Oct 13, 2013
  9. Sep 15, 2013
  10. Feb 11, 2013
  11. Feb 10, 2013
  12. Feb 07, 2013
  13. Oct 23, 2012
  14. Jun 15, 2012
  15. Oct 29, 2011
  16. Oct 26, 2011
  17. Oct 19, 2011
  18. Oct 16, 2011
  19. Oct 14, 2011
  20. Oct 11, 2011
  21. Oct 10, 2011
  22. Oct 09, 2011
  23. Oct 08, 2011
  24. Sep 09, 2011
  25. Sep 07, 2011
  26. Sep 05, 2011
Loading