Skip to content

Commit ce943ff

Browse files
[MERGE chakra-core#766] Add new cross-platform APIs to Jsrt
Merge pull request chakra-core#766 from digitalinfinity:linux_jsrt_master This change introduces the cross-platform API shape for JSRT. It starts with the following assumptions: - Changing the definition of existing APIs is ok, as long as the effective shape doesnt change (so it's fine to use new macros etc as long as signature/calling convention/linkage etc doesn't change) - Existing APIs which take wchar_t* as a parameter will be exposed only on Windows - New variants of these APIs that take in UTF-8 strings will be exposed on *all* platforms Here is a summary of the changes: New macros introduced: CHAKRA_CALLBACK - Calling convention attribute of callback functions consumed by jsrt APIs. Used in place of Win32 CALLBACK macro. CHAKRA_API - Calling convention, linkage and return type of Jsrt APIs (always returns JsErrorCode). Used in place of Win32 STDAPI_ macro. New types introduced ChakraCookie - Type of cookies consumed by Jsrt Apis. Used in place of Win32 DWORD_PTR datatype. JsSerializedScriptLoadUtf8SourceCallback - Callback called to load source code of serialized script encoded as utf8 Following APIs become WIN32 only: JsParseScript JsParseScriptWithFlags JsRunScript JsExperimentalApiRunModule JsSerializeScript JsParseSerializedScriptWithCallback JsRunSerializedScriptWithCallback JsParseSerializedScript JsRunSerializedScript JsGetPropertyIdFromName JsGetPropertyNameFromId JsPointerToString JsStringToPointer New APIs introduced (available on all platforms): JsParseScriptUtf8 JsParseScriptWithAttributesUtf8 JsRunScriptUtf8 JsExperimentalApiRunModuleUtf8 JsRunScriptUtf8 JsExperimentalApiRunModuleUtf8 JsSerializeScriptUtf8 JsParseSerializedScriptUtf8 JsRunSerializedScriptUtf8 JsGetPropertyIdFromNameUtf8 JsGetPropertyNameFromIdUtf8 JsPointerToStringUtf8 JsStringToPointerUtf8 Couple notes: - All utf8 strings are passed in as char* - All string parameters in the new APIs are utf8 (e.g source, url etc).
2 parents a3f2d6d + 5c74acc commit ce943ff

3 files changed

Lines changed: 816 additions & 467 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Build/VCBuild/
99
Build/VCBuild.NoJIT/
1010
Build/ipch/
1111
Build/.vs/
12+
Build/Chakra.Core.VC.db
1213
build_*.log
1314
build_*.wrn
1415
build_*.err

0 commit comments

Comments
 (0)