ChakraCore is an open source Javascript engine with a C API.

ChakraCore

Discord Chat Licensed under the MIT License PR's Welcome

ChakraCore is a Javascript engine with a C API you can use to add support for Javascript to any C or C compatible project. It can be compiled for x64 processors on Linux macOS and Windows. And x86 and ARM for windows only. It is a future goal to support x86 and ARM processors on Linux and ARM on macOS.

Future of ChakraCore

As you may have heard Microsoft Edge no longer uses Chakra. Microsoft will continue to provide security updates for ChakraCore 1.11 until 9th March 2021 but do not intend to support it after that.

ChakraCore is planned to continue as a community project targeted primarily at embedded use cases. We hope to produce future releases with new features and enhancements to support such use cases. We also would like to invite any interested parties to be involved in this project. For further details please see the following draft planning documents: Overall plan Version 1.12 plan

Also see discussion in issue #6384

If you'd like to contact the community team please either open an issue or join the discord chat linked above.

Security

If you believe you have found a security issue in ChakraCore 1.11, please share it with Microsoft privately following the guidance at the Microsoft Security TechCenter. Reporting it via this channel helps minimize risk to projects built with ChakraCore.

If you find a security issue in the Master branch of Chakracore but not in 1.11 please join our discord server and private message one of the Core team members.

Documentation

Building ChakraCore

You can build ChakraCore on Windows 7 SP1 or above, and Windows Server 2008 R2 or above, with either Visual Studio 2015 or 2017 with C++ support installed. Once you have Visual Studio installed:

  • Clone ChakraCore through git clone https://github.com/Microsoft/ChakraCore.git
  • Open Build\Chakra.Core.sln in Visual Studio
  • Build Solution

On macOS you can build ChakraCore with the xcode command line tools and cmake. On Linux you can build ChakraCore with cmake and ninja.

More details in Building ChakraCore.

Alternatively, see Getting ChakraCore binaries for pre-built ChakraCore binaries.

Using ChakraCore

Once built, you have a few options for how you can use ChakraCore:

  • The most basic is to test the engine is running correctly with the application ch.exe (ch on linux or macOS). This app is a lightweight host of ChakraCore that you can use to run small applications. After building, you can find this binary in:
    • Windows: Build\VcBuild\bin\${platform}_${configuration} (e.g. Build\VcBuild\bin\x64_debug)
    • Mac/Linux: buildFolder/config/ch (e.g. out/Release/ch)
  • You can embed ChakraCore in your applications - see documentation and samples.

A note about using ChakraCore: ChakraCore is a JavaScript engine, it does not include the external APIs that are provided by a Web Browser or nodejs. For example, DOM APIs like document.write() are additional APIs that are not provided by ChakraCore, when embedding ChakraCore in an application you will need to implement your own input and output APIs. For debugging, in ch you can use print() to put text to the terminal.

Alternatively, if you are using the vcpkg dependency manager you can download and install ChakraCore with CMake integration in a single command:

  • vcpkg install chakracore

Contribute

Contributions to ChakraCore are welcome. Here is how you can contribute to ChakraCore:

Please refer to Contribution Guidelines for more details.

License

Code licensed under the MIT License.

Contact Us

If you have questions about ChakraCore, or you would like to reach out to us about an issue you're having or for development advice as you work on a ChakraCore issue, you can reach us as follows:

  • Open an issue and prefix the issue title with [Question]. See Question tag for already-opened questions.
  • Discuss ChakraCore with the team and the community via the Discord link above
Comments
  • Fix various spelling errors.

    Fix various spelling errors.

    Fix various spelling errors.

    Fixes misspellings of:

    • a..z (the English alphabet sequence a..z with one pair of letters transposed)
    • actual
    • algorithm
    • amount
    • although
    • argument
    • array
    • as
    • assignment
    • auxiliary
    • availability
    • avoiding
    • because
    • beginning
    • built
    • canonicalization
    • canonical
    • catch
    • causes
    • collection
    • committed
    • compare
    • comparison
    • compilation
    • completed
    • concurrent
    • conditions
    • constructor
    • contain
    • context
    • contiguous
    • conversion
    • convert
    • corresponding
    • counterparts
    • coverage
    • covered
    • current
    • declaration
    • default
    • deferred
    • delimiters
    • dependencies
    • descriptions
    • descriptor
    • diagonal
    • dictionary
    • differently
    • different
    • disposed
    • dynamically
    • dynamic
    • earlier
    • emitting
    • empty
    • emulated
    • encodable
    • enough
    • entrypoint
    • enumerable
    • environment
    • evaluate
    • everything
    • exactly
    • exception
    • exercised
    • existing
    • expandos
    • explicitly
    • extension
    • floatarray
    • for-in
    • foreign
    • function
    • generate
    • generator
    • granularity
    • identical
    • implemented
    • implicit
    • inclusive
    • index
    • indicate
    • indicating
    • infinity
    • initializer
    • initial
    • injection
    • inlinable
    • inline
    • insertion
    • instance
    • instantiate
    • interior
    • interpreter
    • interpret
    • invalidation
    • invoke
    • iterable
    • iterator
    • javascript
    • label
    • lambda
    • lane
    • language
    • left
    • length
    • manager
    • maximum
    • member
    • memory
    • message
    • metadata
    • necessarily
    • occurrence
    • offset
    • offsets
    • of lit (two word sequence)
    • ofobj
    • ofreturn
    • optimization
    • original
    • outer
    • output
    • overridable
    • overridden
    • owning
    • parameter
    • participate
    • perlargest
    • physical
    • pollute
    • polyfill
    • polymorphic
    • popping
    • possibility
    • preceded
    • precise
    • precision
    • preferenced
    • primitive
    • processed
    • profiled
    • profile
    • program
    • progress
    • propagate
    • prop'd
    • properties
    • property
    • prototype
    • recycler
    • re-enable
    • referenceable
    • reference
    • registers
    • removed
    • required
    • result
    • semantics
    • semicolon
    • separately
    • separator
    • sequences
    • should
    • sibling
    • signature
    • similar
    • simultaneously
    • source
    • sources
    • spec'd
    • specialization
    • statement
    • store
    • straight
    • subtags
    • succeed
    • successful
    • sufficient
    • summation
    • supplied
    • supported
    • support
    • surrogate
    • telemetry
    • ternary
    • testing
    • then
    • the
    • though
    • threshold
    • timing
    • transferred
    • traversal
    • truncation
    • typespec'd
    • underflow
    • uninitialized
    • unknown
    • unless
    • unregister
    • unroll
    • unscopable
    • using
    • value
    • variable
    • verifies
    • verify
    • visitor
    • without
    • zero

    brand:

    • ForceES5Array

    grammar:

    • a/an
    • any one of the ... is
    • as an input/output
    • because
    • be replaced
    • different thresholds
    • have
    • is
    • is a
    • it is
    • lossless
    • not to report
    • operations
    • required by
    • the
    • true
    • a tortured sentence involving interleaving

    Tagging an ambiguous token with a guess

    • pronunciation

    Whitespace

    Review on Reviewable

  • [Community] What are you building with ChakraCore?

    [Community] What are you building with ChakraCore?

    With our efforts to enable cross-platform development, and recently, to enable the use of NuGet packages for ChakraCore development with .NET and Native apps (#85), as well as other work we've been doing to enable other scenarios, we're interested in hearing from the community about what you've been building with ChakraCore, and what you would like to build.

    Besides the issues you file, the feedback you give us on Gitter, and other tags of the ChakraCore project, we don't have as much visibility into your needs as we would like, we're hoping to hear from you about anything you'd like to share with us about your projects.

    Some questions we have in mind:

    • What projects are you working on?
    • What have your experiences been when working with ChakraCore?
    • Is our documentation helpful? If not, how can we improve? Were you able to find answers to your questions?
    • Have you written any blog posts or made any other public documentation about your experiences with ChakraCore? We'd love to read them!
    • Is there anything we can do to improve your development experiences?
    • Are you interested in contributing to ChakraCore but something is blocking you from making progress?

    Below, I’m tagging some folks who replied to #85, various other GitHub issues, and/or on Gitter with interest in a NuGet package for .NET and/or Native apps, or have otherwise indicated interest in developing with ChakraCore:

    @resnyanskiy @gulbanana @ormico @jimmcslim @Oceanswave @matthargett @pre10der @MartinJohns @Fishrock123 @WickedA @jackTheRipper @dthompso99 @CatCatCatDog @fubar-coder @alexhultman @snowmantw @kphillisjr @TomSeymour @navidR @liydu @likidu @lwansbrough @atanasovg @galvesribeiro @ReubenBond @ninlar @kostaspl @lwansbrough, etc.

    /cc @digitalinfinity @boingoing @liminzhu @bterlson @aruneshchandra @edmaurer @sethgaurav

  • Discuss JsRTDebugging APIs

    Discuss JsRTDebugging APIs

    I have implemented significant part of new APIs to debug ChakraCore and flushed most of bugs using debugger implemented in ch.

    Before opening the PR request for merging code from JsRTDebugging to master it will be good to discuss the APIs name, signature and arguments.

    Please take a look at https://github.com/Microsoft/ChakraCore/blob/JsRTDebugging/lib/Jsrt/ChakraDebug.h and provide any feedback you have.

  • Chromium adoption in Microsoft Edge and future of ChakraCore

    Chromium adoption in Microsoft Edge and future of ChakraCore

    Hello Friends of ChakraCore,

    Yesterday, Microsoft Edge announced its intent to adopt the Chromium open source project in the development of desktop Microsoft Edge to create better web compatibility and less fragmentation for web developers and customers. You can read the announcement blog for more information.

    We’ve seen your questions for ChakraCore and we want to be transparent and honest with the open-source community that has given us so much support. To be compatible with the rest of the platform and reduce interoperability risks, Microsoft Edge will use the V8 engine as part of this change. There is much to build and learn, but we’re excited to take part in the V8 community and start contributing to the project.

    ChakraCore is currently being used in various projects outside the browser. So, despite the change of direction for Microsoft Edge, our team will continue supporting ChakraCore. We will ensure that any security vulnerability is patched in a timely manner, apart from bringing other enhancements to the engine. The project will also continue taking public contributions.

    As the team learns from the move to support and contribute to Chromium and V8, we’ll keep the community informed about our progress and adjustments, if any, that we’ll need to make.

    ChakraCore team

  • rename /lib/ files to CamelCase

    rename /lib/ files to CamelCase

    We had a mix of inconsistent file name styles. This creates problems on Linux as we had to modify source code includes to the same casing as real file names. This change attempts rename (most) /lib/ files to CamelCase.

    lib/Backend                         =>  Lib/Backend
    
         BackEnd.cpp                             Backend.cpp
         BackEnd.h                               Backend.h
         BackEndOpcodeAttrAsmJs.cpp              BackendOpCodeAttrAsmJs.cpp
         BackEndOpcodeAttrAsmJs.h                BackendOpCodeAttrAsmJs.h
         BackEndOpCodeList.h                     BackendOpCodeList.h
         CodegenNumberAllocator.cpp              CodeGenNumberAllocator.cpp
         GlobOptBailout.cpp                      GlobOptBailOut.cpp
         SCCLiveness.cpp                         SccLiveness.cpp
         SCCLiveness.h                           SccLiveness.h
    
    
    lib/Backend/amd64                   =>  Lib/Backend/amd64
    
         MdOpcodes.h                             MdOpCodes.h
    
    
    lib/Backend/arm                     =>  Lib/Backend/arm
    
         MdOpcodes.h                             MdOpCodes.h
    
    
    lib/Backend/arm64                   =>  Lib/Backend/arm64
    
         MdOpcodes.h                             MdOpCodes.h
    
    
    lib/Backend/i386                    =>  Lib/Backend/i386
    
         MdOpcodes.h                             MdOpCodes.h
    
    
    lib/common                          =>  Lib/Common
    
         BackEndAPI.h                            BackendApi.h
         commoninl.h                             CommonInl.h
         resource.h                              Resource.h
    
    
    lib/common/common                   =>  Lib/Common/Common
    
         cfglogger.cpp                           CfgLogger.cpp
         cfglogger.h                             CfgLogger.h
         GetCurrentFrameID.h                     GetCurrentFrameId.h
         int16math.h                             Int16Math.h
         SmartFPUControl.cpp                     SmartFpuControl.cpp
         SmartFPUControl.h                       SmartFpuControl.h
    
    
    lib/common/core                     =>  Lib/Common/Core
    
         api.h                                   Api.h
         AutoFILE.h                              AutoFile.h
    
    
    lib/common/DataStructures           =>  Lib/Common/DataStructures
    
         comparer.h                              Comparer.h
         dictionary.h                            Dictionary.h
         Dlist.h                                 DList.h
         growingArray.cpp                        GrowingArray.cpp
         growingArray.h                          GrowingArray.h
         interval.h                              Interval.h
         list.h                                  List.h
         stack.h                                 Stack.h
    
    
    lib/common/Exceptions               =>  Lib/Common/Exceptions
    
         reporterror.cpp                         ReportError.cpp
         reporterror.h                           ReportError.h
    
    
    lib/common/Memory                   =>  Lib/Common/Memory
    
         collectionstate.h                       CollectionState.h
         heapblock.inl                           HeapBlock.inl
         heapbucket.cpp                          HeapBucket.cpp
         heapbucket.h                            HeapBucket.h
         heapbucket.inl                          HeapBucket.inl
         heapinfo.cpp                            HeapInfo.cpp
         heapinfo.h                              HeapInfo.h
         leakreport.cpp                          LeakReport.cpp
         leakreport.h                            LeakReport.h
    
    
    lib/common/util                     =>  Lib/Common/Util
    
         pinned.cpp                              Pinned.cpp
         pinned.h                                Pinned.h
    
    
    lib/jsrt                            =>  Lib/Jsrt
    
         chakracommon.h                          ChakraCommon.h
         jsrtcontext.cpp                         JsrtContext.cpp
         jsrtcontext.h                           JsrtContext.h
         jsrtExternalObject.cpp                  JsrtExternalObject.cpp
         jsrtExternalObject.h                    JsrtExternalObject.h
         jsrtinternal.h                          JsrtInternal.h
         jsrtRuntime.cpp                         JsrtRuntime.cpp
         jsrtRuntime.h                           JsrtRuntime.h
         jsrtThreadService.cpp                   JsrtThreadService.cpp
         jsrtThreadService.h                     JsrtThreadService.h
    
    
    lib/Parser                          =>  Lib/Parser
    
         alloc.cpp                               Alloc.cpp
         alloc.h                                 Alloc.h
         hash.cpp                                Hash.cpp
         hash.h                                  Hash.h
         hashfunc.cpp                            HashFunc.cpp
         jsscan.js                               JsScan.js
         parse.cpp                               Parse.cpp
         parse.h                                 Parse.h
         regcodes.h                              RegCodes.h
         RegexOpcodes.h                          RegexOpCodes.h
         RegexRunTime.cpp                        RegexRuntime.cpp
         RegexRunTime.h                          RegexRuntime.h
         scan.cpp                                Scan.cpp
         scan.h                                  Scan.h
    
    
    lib/Runtime/Base                    =>  Lib/Runtime/Base
    
         scriptcontextbase.h                     ScriptContextBase.h
         ThreadContextTLSEntry.cpp               ThreadContextTlsEntry.cpp
         ThreadContextTLSEntry.h                 ThreadContextTlsEntry.h
         threadservicewrapper.h                  ThreadServiceWrapper.h
    
    
    lib/Runtime/ByteCode                =>  Lib/Runtime/ByteCode
    
         AsmJSByteCodeDumper.cpp                 AsmJsByteCodeDumper.cpp
         AsmJSByteCodeDumper.h                   AsmJsByteCodeDumper.h
         BackEndOpcodeAttr.cpp                   BackendOpCodeAttr.cpp
         BackEndOpcodeAttr.h                     BackendOpCodeAttr.h
         ByteCodeAPI.h                           ByteCodeApi.h
         byteCodeCacheReleaseFileVersion.h       ByteCodeCacheReleaseFileVersion.h
         Opcodes.cpp                             OpCodes.cpp
    
    
    lib/Runtime/Language                =>  Lib/Runtime/Language
    
         asmjs.cpp                               AsmJs.cpp
         AsmJS.h                                 AsmJs.h
         AsmJsBuiltinNames.h                     AsmJsBuiltInNames.h
         AsmJSBytecodeGenerator.cpp              AsmJsByteCodeGenerator.cpp
         AsmJSBytecodeGenerator.h                AsmJsByteCodeGenerator.h
         AsmJSCodeGenerator.cpp                  AsmJsCodeGenerator.cpp
         AsmJSCodeGenerator.h                    AsmJsCodeGenerator.h
         AsmJSEncoder.cpp                        AsmJsEncoder.cpp
         AsmJSEncoder.h                          AsmJsEncoder.h
         AsmJSEncoder.inl                        AsmJsEncoder.inl
         AsmJSEncoderHandler.inl                 AsmJsEncoderHandler.inl
         AsmJSJitTemplate.h                      AsmJsJitTemplate.h
         AsmJSLink.cpp                           AsmJsLink.cpp
         AsmJSLink.h                             AsmJsLink.h
         AsmJSModule.cpp                         AsmJsModule.cpp
         AsmJSModule.h                           AsmJsModule.h
         AsmJSTypes.cpp                          AsmJsTypes.cpp
         AsmJSTypes.h                            AsmJsTypes.h
         AsmJSUtils.cpp                          AsmJsUtils.cpp
         AsmJSUtils.h                            AsmJsUtils.h
         SIMDBool16x8Operation.cpp               SimdBool16x8Operation.cpp
         SIMDBool16x8Operation.h                 SimdBool16x8Operation.h
         SIMDBool16x8OperationX86X64.cpp         SimdBool16x8OperationX86X64.cpp
         SIMDBool32x4Operation.cpp               SimdBool32x4Operation.cpp
         SIMDBool32x4Operation.h                 SimdBool32x4Operation.h
         SIMDBool32x4OperationX86X64.cpp         SimdBool32x4OperationX86X64.cpp
         SIMDBool8x16Operation.cpp               SimdBool8x16Operation.cpp
         SIMDBool8x16Operation.h                 SimdBool8x16Operation.h
         SIMDBool8x16OperationX86X64.cpp         SimdBool8x16OperationX86X64.cpp
         SIMDFloat32x4Operation.cpp              SimdFloat32x4Operation.cpp
         SIMDFloat32x4Operation.h                SimdFloat32x4Operation.h
         SIMDfloat32x4OperationX86X64.cpp        SimdFloat32x4OperationX86X64.cpp
         SIMDFloat64x2Operation.cpp              SimdFloat64x2Operation.cpp
         SIMDFloat64x2Operation.h                SimdFloat64x2Operation.h
         SIMDfloat64x2OperationX86X64.cpp        SimdFloat64x2OperationX86X64.cpp
         SIMDInt16x8Operation.cpp                SimdInt16x8Operation.cpp
         SIMDInt16x8Operation.h                  SimdInt16x8Operation.h
         SIMDInt16x8OperationX86X64.cpp          SimdInt16x8OperationX86X64.cpp
         SIMDInt32x4Operation.cpp                SimdInt32x4Operation.cpp
         SIMDInt32x4Operation.h                  SimdInt32x4Operation.h
         SIMDInt32x4OperationX86X64.cpp          SimdInt32x4OperationX86X64.cpp
         SIMDInt8x16Operation.cpp                SimdInt8x16Operation.cpp
         SIMDInt8x16Operation.h                  SimdInt8x16Operation.h
         SIMDInt8x16OperationX86X64.cpp          SimdInt8x16OperationX86X64.cpp
         SIMDUint16x8Operation.cpp               SimdUint16x8Operation.cpp
         SIMDUint16x8Operation.h                 SimdUint16x8Operation.h
         SIMDUint16x8OperationX86X64.cpp         SimdUint16x8OperationX86X64.cpp
         SIMDUInt32x4Operation.cpp               SimdUint32x4Operation.cpp
         SIMDUInt32x4Operation.h                 SimdUint32x4Operation.h
         SIMDUInt32x4OperationX86X64.cpp         SimdUint32x4OperationX86X64.cpp
         SIMDUint8x16Operation.cpp               SimdUint8x16Operation.cpp
         SIMDUint8x16Operation.h                 SimdUint8x16Operation.h
         SIMDUint8x16OperationX86X64.cpp         SimdUint8x16OperationX86X64.cpp
         SIMDUtils.cpp                           SimdUtils.cpp
         SIMDUtils.h                             SimdUtils.h
    
    
    lib/Runtime/Language/amd64          =>  Lib/Runtime/Language/amd64
    
         AsmJSJitTemplate.cpp                    AsmJsJitTemplate.cpp
         stackframe.cpp                          StackFrame.cpp
         stackframe.h                            StackFrame.h
         stackframe.inl                          StackFrame.inl
    
    
    lib/Runtime/Language/arm            =>  Lib/Runtime/Language/arm
    
         stackframe.cpp                          StackFrame.cpp
         stackframe.h                            StackFrame.h
    
    
    lib/Runtime/Language/arm64          =>  Lib/Runtime/Language/arm64
    
         stackframe.cpp                          StackFrame.cpp
         stackframe.h                            StackFrame.h
    
    
    lib/Runtime/Language/i386           =>  Lib/Runtime/Language/i386
    
         AsmJSJitTemplate.cpp                    AsmJsJitTemplate.cpp
         stackframe.cpp                          StackFrame.cpp
         stackframe.h                            StackFrame.h
    
    
    lib/Runtime/Library                 =>  Lib/Runtime/Library
    
         dataview.cpp                            DataView.cpp
         dataview.h                              DataView.h
         JavascriptSIMDBool16x8.cpp              JavascriptSimdBool16x8.cpp
         JavascriptSIMDBool16x8.h                JavascriptSimdBool16x8.h
         JavascriptSIMDBool32x4.cpp              JavascriptSimdBool32x4.cpp
         JavascriptSIMDBool32x4.h                JavascriptSimdBool32x4.h
         JavascriptSIMDBool8x16.cpp              JavascriptSimdBool8x16.cpp
         JavascriptSIMDBool8x16.h                JavascriptSimdBool8x16.h
         JavascriptSIMDFloat32x4.cpp             JavascriptSimdFloat32x4.cpp
         JavascriptSIMDFloat32x4.h               JavascriptSimdFloat32x4.h
         JavascriptSIMDFloat64x2.cpp             JavascriptSimdFloat64x2.cpp
         JavascriptSIMDFloat64x2.h               JavascriptSimdFloat64x2.h
         JavascriptSIMDInt16x8.cpp               JavascriptSimdInt16x8.cpp
         JavascriptSIMDInt16x8.h                 JavascriptSimdInt16x8.h
         JavascriptSIMDInt32x4.cpp               JavascriptSimdInt32x4.cpp
         JavascriptSIMDInt32x4.h                 JavascriptSimdInt32x4.h
         JavascriptSIMDInt8x16.cpp               JavascriptSimdInt8x16.cpp
         JavascriptSIMDInt8x16.h                 JavascriptSimdInt8x16.h
         JavascriptSIMDUint16x8.cpp              JavascriptSimdUint16x8.cpp
         JavascriptSIMDUint16x8.h                JavascriptSimdUint16x8.h
         JavascriptSIMDUInt32x4.cpp              JavascriptSimdUint32x4.cpp
         JavascriptSIMDUInt32x4.h                JavascriptSimdUint32x4.h
         JavascriptSIMDUint8x16.cpp              JavascriptSimdUint8x16.cpp
         JavascriptSIMDUint8x16.h                JavascriptSimdUint8x16.h
         javascripttypednumber.cpp               JavascriptTypedNumber.cpp
         javascripttypednumber.h                 JavascriptTypedNumber.h
         moduleroot.cpp                          ModuleRoot.cpp
         moduleroot.h                            ModuleRoot.h
         SIMDBool16x8Lib.cpp                     SimdBool16x8Lib.cpp
         SIMDBool16x8Lib.h                       SimdBool16x8Lib.h
         SIMDBool32x4Lib.cpp                     SimdBool32x4Lib.cpp
         SIMDBool32x4Lib.h                       SimdBool32x4Lib.h
         SIMDBool8x16Lib.cpp                     SimdBool8x16Lib.cpp
         SIMDBool8x16Lib.h                       SimdBool8x16Lib.h
         SIMDFloat32x4Lib.cpp                    SimdFloat32x4Lib.cpp
         SIMDFloat32x4Lib.h                      SimdFloat32x4Lib.h
         SIMDFloat64x2Lib.cpp                    SimdFloat64x2Lib.cpp
         SIMDFloat64x2Lib.h                      SimdFloat64x2Lib.h
         SIMDInt16x8Lib.cpp                      SimdInt16x8Lib.cpp
         SIMDInt16x8Lib.h                        SimdInt16x8Lib.h
         SIMDInt32x4Lib.cpp                      SimdInt32x4Lib.cpp
         SIMDInt32x4Lib.h                        SimdInt32x4Lib.h
         SIMDInt8x16Lib.cpp                      SimdInt8x16Lib.cpp
         SIMDInt8x16Lib.h                        SimdInt8x16Lib.h
         SIMDUint16x8Lib.cpp                     SimdUint16x8Lib.cpp
         SIMDUint16x8Lib.h                       SimdUint16x8Lib.h
         SIMDUInt32x4Lib.cpp                     SimdUint32x4Lib.cpp
         SIMDUInt32x4Lib.h                       SimdUint32x4Lib.h
         SIMDUint8x16Lib.cpp                     SimdUint8x16Lib.cpp
         SIMDUint8x16Lib.h                       SimdUint8x16Lib.h
         typedArrayEnumerator.cpp                TypedArrayEnumerator.cpp
         typedArrayEnumerator.h                  TypedArrayEnumerator.h
    
    
    lib/Runtime/Library/amd64           =>  Lib/Runtime/Library/amd64
    
         javascriptfunctiona.asm                 JavascriptFunctionA.asm
    
    
    lib/Runtime/Library/InJavascript    =>  Lib/Runtime/Library/InJavascript
    
         intl.js.bc.32b.h                        Intl.js.bc.32b.h
         intl.js.bc.64b.h                        Intl.js.bc.64b.h
    
  • Fix debugger ignoring exceptions thrown after an await

    Fix debugger ignoring exceptions thrown after an await

    If code such as the snippet below is run under the debugger, the host is not notified of the thrown exception via JsDiagDebugEventRuntimeException:

    (async () => {
        await null;
        throw new Error();
    })();
    

    Note that moving the throw before the await makes the debugger able to intercept it again. This issue occurs because of an AutoCatchHandlerExists being in scope when the promise reaction is run: https://github.com/Microsoft/ChakraCore/blob/ad79be8811806622190b55266c73f20b600ed46c/lib/Runtime/Library/JavascriptPromise.cpp#L1037-L1051

    The fix is to not construct an AutoCatchHandlerExists in this situation. While the exception is indeed caught and squelched, it's not actually swallowed but converted to a promise rejection, which may well be fatal depending on the host. We need the debugger to be able to intercept it before that happens so the user can view the callstack, variables, etc. before the stack is unwound.

    There is no test coverage for this yet, I will try to add some in the next day or so.

    Fixes #4630.

  • Function.prototype.call returns the function itself instead of the real return value

    Function.prototype.call returns the function itself instead of the real return value

    I have convinced myself, that I am looking at an optimization issue in EdgeHTML 14. The most annoying part is, that it doesn't reproduce when the F12 tools are open.

    I'm building an application including the new d3 version 4, angular2, and core-js' es6 modules (amongst other things). Everything is bundled with webpack. I have tried to reduce the problem by editing the webpack-generated JavaScript and removing some of the moving parts, but that seems to fix it. I'll try to describe my environment, some code snippets etc., but I wouldn't expect this to be easy to reproduce.

    The problem appears in the range function, more exactly in the range = slice.call(_) assignment in the first branch. slice is imported from array.js and is just Array.prototype.slice.

    The first three times this function gets called (when arguments.length === 1, an array with two elements), the .call(_) returns the expected copy of that array. The fourth time, range gets function slice() { [native code] } assigned instead.

    With webpack in the picture, here is what the browser actually executes:

    /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__array__ = __webpack_require__(22);
    
    // […]
    
      scale.range = function(_) {
        return arguments.length ? (range = __WEBPACK_IMPORTED_MODULE_2__array__["a" /* slice */].call(_), rescale()) : range.slice();
      };
    

    or my debug version:

      scale.range = function (_) {
          var result;
          if (arguments.length) {
              console.log('change!');
              console.log(range);
              range = __WEBPACK_IMPORTED_MODULE_2__array__["a" /* slice */].call(_);
              console.log(range);
              result = rescale();
          }
          else {
              result = range.slice();
          }
          return result;
      };
    

    I have rerouted console.log() and console.error() to append the logs to a DOM element, so I have a chance to see what happened when I open the F12 tools after things blew up. The log is:

    Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
    change!
    0,1
    278.3333333333333,0
    change!
    0,1
    0,885
    change!
    0,1
    278.3333333333333,0
    change!
    0,1
    function slice() { [native code] }
    

    Continuing the program executing then runs into an exception when the range function is called without arguments:

    TypeError: Object doesn't support property or method 'slice'
      at scale.range (…)
      at …
    

    I have verified, that the webpack imported slice function is always the same. I have tried to inline the webpack infrastructure, but that fixes the problem. The same code works beautifully in Chrome. The code works (much slower) when the F12 are open.

    Help!

  • Implementation of Object.getOwnPropertyDescriptors.

    Implementation of Object.getOwnPropertyDescriptors.

    Fixes #254

    This is a rough implementation based on a combination of getOwnPropertyDescriptor as a reference, and what I could intuit from a day of digging.

    I'd appreciate as much feedback as possible on how I did this. I used existing functions I was aware of when possible, but if there are better choices of helper functions here, please do let me know. I also did the tests all in javascript (similar to what I could find on getOwnPropertyDescriptor), and tried to make them as thorough as possible.

  • ch: Get error string from exception when error `stack` is undefined

    ch: Get error string from exception when error `stack` is undefined

    When out of memory happens, exception value reference doesn’t have a stack property or stack is undefined.

    This update converts exception value reference to string in such case to produce a meaningful output.

    To test the issue, run script below with ch:

    var arr = [];
    for(var i=0;i<1e9;i++)
     arr[i]  = i%9;
    
    print(“-> " + arr[Date.now()%1e9]);
    
  • [Discussion] Linux / Cross-platform planning

    [Discussion] Linux / Cross-platform planning

    This is for general discussions on the cross-platfrom effort. Please open individual issues for tasks clearly identified from this discussion, or PRs if they are small and you can do them quickly.

    Please see the Roadmap for our cross-platform checklist and progress.

    Related issues:

    • [ ] #197
    • [ ] #198
    • [ ] #200

    See https://github.com/caitp/ChakraCore/issues/1 for some examples of work items we might want to consider.

  • icu-intl: Ubuntu 14LTS build break

    icu-intl: Ubuntu 14LTS build break

    We have icu-intl is enabled by default now. ICU-intl impl. uses couple of ICU API those are not available on ICU 52. Although we don't say we officially support any of these, we could simply feature detect and pick API we can use and keep the number of platforms we support.

    IMHO we shouldn't break our default build with Ubuntu 14LTS

  • Support lacking for Apple Silicon (ARM)

    Support lacking for Apple Silicon (ARM)

    On ARM macOS (all versions), ./build.sh --icu=/opt/homebrew/opt/icu4c/include -j=4 -y --lto-thin leads to:

    CMake Error at CMakeLists.txt:47 (message):
        Couldn't detect target processor, try `--arch` argument with build.sh
    
  • Invalidate `IsInstInlineCache` in `Object.setPrototypeOf`

    Invalidate `IsInstInlineCache` in `Object.setPrototypeOf`

    Using Object.setPrototypeOf may result in instanceof returning the wrong result, as the IsInstInlineCache is not invalidated (See #5915).

    Steps:

    • Iterate over the existing function -> IsInstInlineCache[] dictionary using the new ThreadContext.MapIsInstInlineCaches function
    • Walk the prototype chain to check for the cached type
    • Ignore if type is null https://github.com/chakra-core/ChakraCore/blob/0cfe82d202c0298f4bbde06070f8dbf9099946c8/lib/Runtime/Library/JavascriptFunction.cpp#L3365-L3367
    • If found, remove from list using ThreadContext.UnregisterIsInstInlineCache (corrects next) and ...
    • Invalidate using memset

    I couldn't come up with a scenario where the function could be affected (x instance of function). Therefore, the following code should not be necessary (not included in latest commit): https://github.com/chakra-core/ChakraCore/blob/2d7e459c40cbf12efff28e00811dc768b7d52f65/lib/Runtime/Library/JavascriptObject.cpp#L255-L272


    @rhuanjl

    Fixes #5915

  • Deprecation of `Ubuntu 18.04` Actions (DevOps)

    Deprecation of `Ubuntu 18.04` Actions (DevOps)

    Ubuntu18 tests will already fail during scheduled brownout. They will be fully unsupported by 4/1/2023.

    See https://github.com/actions/runner-images/issues/6002, #6831. PR: https://github.com/chakra-core/ChakraCore/pull/6833

  • Potential Clang 12 miscompilation

    Potential Clang 12 miscompilation

    OS: Ubuntu 22.04 x86-64 Compiler: Clang ~14.0.0~12.0.1 CMake build type: RelWithDebInfo

    Bytecode generation for verification segfaults:

    $ ./ch -GenerateLibraryByteCodeHeader -LdChakraLib -JsBuiltIn /path/to/ChakraCore/tools/../lib/Runtime/Library/InJavascript/Array_prototype.js
    Segmentation fault (core dumped)
    

    The crash comes from code in ByteCodeSerializer.cpp, though it might also be related to ImmutableList, or something else.

    $ gdb --args ./ch -GenerateLibraryByteCodeHeader -LdChakraLib -JsBuiltIn /local/petr/ChakraCore/tools/../lib/Runtime/Library/InJavascript/Array_prototype.js
    GNU gdb (Ubuntu 12.0.90-0ubuntu1) 12.0.90
    Copyright (C) 2022 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Type "show copying" and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <https://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
        <http://www.gnu.org/software/gdb/documentation/>.
    
    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from ./ch...
    (gdb) r
    Starting program: /local/petr/ChakraCore/build-test/ch -GenerateLibraryByteCodeHeader -LdChakraLib -JsBuiltIn /local/petr/ChakraCore/tools/../lib/Runtime/Library/InJavascript/Array_prototype.js
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    [New Thread 0x7ff7f43cf640 (LWP 5873)]
    [New Thread 0x7ff7f3b9f640 (LWP 5874)]
    [New Thread 0x7ff7f339e640 (LWP 5875)]
    
    Thread 1 "ch" received signal SIGSEGV, Segmentation fault.
    regex::ImmutableList<Js::BufferBuilder*>::ReverseCurrentList (this=<optimized out>) at /local/petr/ChakraCore/lib/Common/DataStructures/ImmutableList.h:387
    387	                auto next = current->next;
    (gdb) bt
    #0  regex::ImmutableList<Js::BufferBuilder*>::ReverseCurrentList (this=<optimized out>)
        at /local/petr/ChakraCore/lib/Common/DataStructures/ImmutableList.h:387
    #1  Js::ByteCodeBufferBuilder::AddFunction (this=0x7fffffffd9f0, [email protected]=0x7fffffffdd48, 
        builder=..., function=0x7ff7f2b65380, [email protected]=0x7ff7f3ba1e40, [email protected]=0x0)
        at /local/petr/ChakraCore/lib/Runtime/ByteCode/ByteCodeSerializer.cpp:2440
    

    Failure doesn't exist in Debug mode. I've tried to build some files with Debug, but that leads to undefined symbols (as more inlining removes some of the calls), maybe I'll have some more success with Release mode. ~Worth looking into earlier Clang versions, we don't have this failure on Ubuntu 20, where package manager doesn't have Clang 14.~ We didn't have this on Ubuntu 20, which has Clang 10 in the package repo. I can narrow down it to Clang 12 vs Clang 11, latter works.

  • Release 1.11 on Ubuntu 20 and later

    Release 1.11 on Ubuntu 20 and later

    Should we maintain release 1.11 on Ubuntu 20 and newer? Due to updates to the compiler and system headers it does not currently build. I have started working on that, as all the changes should already be known.

Embedded JavaScript engine for C/C++

V7: Embedded JavaScript engine NOTE: this project is deprecated in favor of https://github.com/cesanta/mjs V7 is the smallest JavaScript engine writte

Nov 20, 2022
:sparkles: Magical headers that make your C++ library accessible from JavaScript :rocket:
:sparkles: Magical headers that make your C++ library accessible from JavaScript :rocket:

Quick start | Requirements | Features | User guide | Contributing | License nbind is a set of headers that make your C++11 library accessible from Jav

Nov 14, 2022
Structy is an irresponsibly dumb and simple struct serialization/deserialization library for C, Python, and vanilla JavaScript.

Structy Structy is an irresponsibly dumb and simple struct serialization/deserialization library for C, Python, and vanilla JavaScript. You can think

Sep 13, 2022
C++11 API for creating Lua bindings

=head1 NAME luacxx - C++11 binding and modules for Lua =head1 SYNOPSIS // Create a new Lua environment to play with. auto env = lua::create

Nov 14, 2022
Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:

sol2 sol2 is a C++ library binding to Lua. It currently supports all Lua versions 5.1+ (LuaJIT 2.0+ and MoonJIT included). sol2 aims to be easy to use

Nov 25, 2022
Generates CIL MLIR dialect from C/C++ source.

Build steps -DLLVM_ENABLE_PROJECTS="mlir;clang" in cmake ninja cml should build the cml clang tool ninja check-clang-cml to run the CIL tests. Check c

Oct 21, 2022
ChakraCore bindings for aardio

ChakraCore-bindings-for-aardio ChakraCore is a Javascript engine with a C API you can use to add support for Javascript to any C or C compatible proje

Feb 18, 2022
The Atomic Game Engine is a multi-platform 2D and 3D engine with a consistent API in C++, C#, JavaScript, and TypeScript
The Atomic Game Engine is a multi-platform 2D and 3D engine with a consistent API in C++, C#, JavaScript, and TypeScript

The Atomic Game Engine is a multi-platform 2D and 3D engine with a consistent API in C++, C#, JavaScript, and TypeScript

Nov 15, 2022
Vizzu is a free, open-source Javascript/C++ library for animated data visualizations and data stories.
Vizzu is a free, open-source Javascript/C++ library for animated data visualizations and data stories.

Vizzu is a free, open-source Javascript/C++ library utilizing a generic dataviz engine that generates many types of charts and seamlessly animates between them

Nov 20, 2022
Window.js is an open-source Javascript runtime for desktop graphics programming.

Window.js Window.js is an open-source Javascript runtime for desktop graphics programming. It is documented at windowjs.org. Introduction Window.js pr

Nov 16, 2022
High level HTTP Request Library that gives a javascript fetch like API.

Fetch for Arduino fetch is a high level HTTP Request Library that gives you a javascript fetch like API. ResponseOptions options; options.method = "PO

Oct 25, 2022
Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform AAA Open 3D Engine
Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform AAA Open 3D Engine

Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform 3D engine that enables developers and content creators to build AAA games, cinema-quality 3D worlds, and high-fidelity simulations without any fees or commercial obligations.

Nov 24, 2022
MAZE (My AmaZing Engine) - 🎮 Personal open-source cross-platform game engine
MAZE (My AmaZing Engine)  - 🎮 Personal open-source cross-platform game engine

MAZE (My AmaZing Engine) is the self-written open-source cross-platform game engine in the active development stage. At the moment it is my main pet project, developed for the purpose of learning and preserving different game dev technologies.

Nov 9, 2022
OpenMW is an open-source open-world RPG game engine that supports playing Morrowind.

OpenMW is an open-source open-world RPG game engine that supports playing Morrowind.

Nov 20, 2022
Open Source Cheat for Apex Legends, designed for ease of use. Made to understand reversing of Apex Legends and respawn's modified source engine as well as their Easy Anti Cheat Implementation.
Open Source Cheat for Apex Legends, designed for ease of use. Made to understand reversing of Apex Legends and respawn's modified source engine as well as their Easy Anti Cheat Implementation.

Apex-Legends-SDK Open Source Cheat for Apex Legends, designed for ease of use. Made to understand reversing of Apex Legends and respawn's modified sou

Nov 20, 2022
MySQL Server, the world's most popular open source database, and MySQL Cluster, a real-time, open source transactional database.

Copyright (c) 2000, 2021, Oracle and/or its affiliates. This is a release of MySQL, an SQL database server. License information can be found in the

Nov 24, 2022
This is a list of different open-source video games and commercial video games open-source remakes.

This is a list of different open-source video games and commercial video games open-source remakes.

Nov 19, 2022
Duktape - embeddable Javascript engine with a focus on portability and compact footprint

Duktape ⚠️ Master branch is undergoing incompatible changes for Duktape 3.x. To track Duktape 2.x, follow the v2-maintenance branch. Introduction Dukt

Nov 16, 2022
Embedded JavaScript engine for C/C++

V7: Embedded JavaScript engine NOTE: this project is deprecated in favor of https://github.com/cesanta/mjs V7 is the smallest JavaScript engine writte

Nov 20, 2022
Elk is a tiny embeddable JavaScript engine that implements a small but usable subset of ES6
Elk is a tiny embeddable JavaScript engine that implements a small but usable subset of ES6

Elk is a tiny embeddable JavaScript engine that implements a small but usable subset of ES6. It is designed for microcontroller development. Instead of writing firmware code in C/C++, Elk allows to develop in JavaScript. Another use case is providing customers with a secure, protected scripting environment for product customisation.

Nov 25, 2022