-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
For the JSON parser to work correctly, any external libs must have an internal reference for the compiler to see, for example:
GET=async function(GETURL,POSTURL,callback){
await axios.get(GETURL).then(val=>callback(POSTURL,GETPARSER(val),(data)=>this.LOG(this.OUTPUT_FILE,data)))
}
In this example the GET function is making a reference to axios an external library for http requests. Since the JSON converter does not have a reference to this library it cannot compile. This happens because when instanciating a new function with the function constructor, the function is evaluated and has no reference to the external library. To void this, you must have a reference to the requested library in the prototype of the Event, and when you need the library use the prototypes reference to it. Example:
import axios from 'axios'
....
{
this.axios = axios
GET=async function(GETURL,POSTURL,callback){
await this.axios.get(GETURL).then(val=>callback(POSTURL,GETPARSER(val),(data)=>this.LOG(this.OUTPUT_FILE,data)))
},
}
Metadata
Metadata
Assignees
Labels
No labels