Skip to content

Notes #176

Description

@tbranyen

@3y3 these notes might be handy to you:

-- className - hardcoded
- filename - generated from keyName + .h
- jsClassName - generated from className minus any leading Git
- cppClassName - generated from className

- functions - generated by iterating the functions object, verify `file` attribute
  - cFunctionName - generated by keyName
  - jsFunctionName - generated from lowercased functionName
  - cppFunctionName - generated from functionName
  -- isAsync - hardcoded
  -- isConstructorMethod - harcoded
  -- functionName -hardcoded
  - return - generated from return
    - cType - generated from return.type
    - cppClassName - (TODO create dictionary of cType to cppClassName)
    - jsClassName - (TODO create dictionary of cType to jsClassName)
    -- isErrorCode - hardcoded for now
  -- args
    -- name - generated from args.name
    -- ctype - generated from args.ctype
    -- cppClassName - (TODO create dictionary of cType to cppClassName)
    -- jsClassName - (TODO create dictionary of cType to jsClassName)
    -- comment - comment


is true when the first argument is the base type and **
  isConstructorMethod: true

  is !isConstructorMethod always
  isPrototypeMethod: false



----------


missing isErrorCode
cpp and js class names were backward

- had to find the cType by hand for every class.  created each one automatically.  was able to tweak code with settings.

new2 -<< rename this somehow, collision in C++ land

missing sys calls, looks like these are necessary for proper backends support

change base.cc to nodegit.cc to avoid future conflicts

-----


- Compile libgit2 with emscripten.
- Generate JS bindings for Node.
- Generate JS bindings for Browser.

----

Look into gifsicle emscripten for webworker information

currently mounting the exact file path inside of emscripten instead of binding
to a randomly generated location that will not conflict and then mapping
manually.

- need browser.js to handle browserify build

--- Resources
http://www.rehanjaffer.com/compiling-c-to-javascript-jquery-with-emscripten/

-- threads.init could spawn webworkers.



-------------------------------------------------------------------------------

dependencies are missing stuff like node_buffer.  how to detect?

isSelf:
  - if not the first argument and the same type as the file cType, then it's self.

isReturn:
  - if the first argument and the same type as the file cType, then it's return.

isErrorCode: 
  - if there is an isReturn in the arguments and the return value is an int, it's an
    errorCode

isAsync:
  - has an isReturn argument, if the return value is not an int, it's synchronous

shouldAlloc:
  - wtf is this?

isFree:
  - No idea??? investigate in templates

copy:
  - investigate in templates

shouldAlloc:
  - investigate in templates

jsName:
  - investigate in templates

size:
  - investigate in templates

isOptional:
  - investigate in templates

additionalCast:
  - set on a per error basis

isPayload:
  - investigate in templates

arrayElementCppClassName:
  - investigate in templates

-----

fields:
- "jsFunctionName": "name",  | inferred from name
- "cppFunctionName": "Name", | inferred from name
- "name": "name",            | set
- "cType": "const char *",   | set
- "cppClassName": "String",  | inferred from cType
- "jsClassName": "String"    | inferred from cType

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions