ClearScript Library
ClearScript Library
Hi @fuweichin, ClearScript also supports custom loaders. You shouldn't have to modify any source code. Let's walk through a simple example. Suppose you've installed xpath-analyzer as follows: ``` bat >...
Hi @Glareone, To be honest, we're unfamiliar with the Azure Functions environment. We'll take a closer look, but it could take some time. We're glad you found a workaround. Thanks!
Hi @DavidBal, Host objects in ClearScript currently don't support `Symbol.dispose`; in fact, V8 defines no such symbol. However, a relevant [proposal](https://github.com/tc39/proposal-explicit-resource-management) appears to be in flight, and TypeScript is evidently...
Hi again, Here's a more complete solution: ``` C# dynamic setupFunc = engine.Evaluate(@"( function (obj, host, IDisposable) { Object.defineProperty(Object.getPrototypeOf(obj), Symbol.dispose, { get() { const disposable = host.asType(IDisposable, this); return disposable...
Hi Andrey, This is indeed a new bug. Note that the script is unimportant in this case, as the heap is larger than 640KiB when the `V8ScriptEngine` constructor returns. We...
Hi @dementcore, You can use a [host variable](https://microsoft.github.io/ClearScript/Reference/html/M_Microsoft_ClearScript_HostFunctions_newVar__1.htm) for this purpose. First, you'll need a [`HostFunctions`](https://microsoft.github.io/ClearScript/Reference/html/T_Microsoft_ClearScript_HostFunctions.htm) object: ``` C# engine.AddHostObject("host", new HostFunctions()); ``` Once you have that, you can do...
Please reopen this issue if you have additional thoughts or questions about this topic. Thank you!
Hi @BinarySpike, >I'd like to wait for a debugger to attach, but not pause directly after. Interesting. Can you describe a situation in which this capability would be useful? To...
Hi @lucasoares, >I would like to have a configuration like the max heap size but to limit how many statements the engine can execute without throwing an exception. Unfortunately, V8...
>Can you think of any workaround for statements? Hmm. Can you clarify what exactly counts as a statement? In order for the limit to be useful, a statement must be...