CondorLang / Condor

A fast, simple, and intelligent new programming language
BSD 3-Clause "New" or "Revised" License
34 stars 11 forks source link

Update script.cc #10

Closed Berkmann18 closed 7 years ago

Berkmann18 commented 7 years ago

I added:

/**
     * @description Added this to find a workout around for {@link https://github.com/CondorLang/Condor/issues/8}
     * @author Berkmann18
     * @since 29/10/16 19:45 BST
     */
    void Script::Free(Isolate* isolate){
        script->Free(isolate);
    }

In order to do the second and third solutions from the issue #8

chaseWillden commented 7 years ago

@Berkmann18. The code is incomplete, that's why it's not compiling. The api.cc function dynamically casts the script object to the Condor::Internal::Script object. Try doing the following:

  1. Pass isolate through as a parameter in shell.cc
  2. Add a void Free(Isolate* isolate) to the script.h
  3. Free the memory in the implementation of that function. The body should look like this:
isolate->FreeMemory(this, sizeof(Script)); 
chaseWillden commented 7 years ago

removed shell.cc and created main.cc to handle the shell and file input.