Skip to content

Instantly share code, notes, and snippets.

@davisp
Created April 17, 2020 16:54
Show Gist options
  • Select an option

  • Save davisp/85062ff349d1f7a30fa543c4ce328468 to your computer and use it in GitHub Desktop.

Select an option

Save davisp/85062ff349d1f7a30fa543c4ce328468 to your computer and use it in GitHub Desktop.

http.cpp

Can change for 60:

  1. state->recvbuf = static_cast<char*>(JS_malloc(...))
  2. tmp = static_cast<char*>(JS_realloc(...))

main.cpp

Questions:

  1. Changes to request scoping?

Can change for 60:

  1. JS_BeginRequest/JSAutoRequest, are we missing a JS_EndRequest?
  2. Move AutoStableStringChars to shorten diffs?
  3. Can alias args->scripts[i] to shorten diff
  4. Replace JS_THIS_OBJECT with some form of GET_THIS

util.cpp

Questions:

  1. Added a sawNewline in couch_readline?
  2. exc_state.restore() is likely not needed? Unless we want to clobber on purpose? (JS_EncodeStringToUTF8)

Can change for 60:

  1. Move AutoExceptionState from couch_print to js_to_string
  2. tmp = static_cast<char*>(JS_realloc(...))
  3. tmp = static_cast<char*>(JS_realloc(...))
  4. str = string_to_js(cx, std::string(tmp, byteslen)) <- byteslen and off by one?
  5. Check definition of JSFunctionSpec*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment