@01/as-virtual-code
Advanced tools
Comparing version 0.0.1-alpha to 0.0.1-alpha1
@@ -24,3 +24,3 @@ import { JSON } from "assemblyscript-json"; | ||
export class ExecutionResult { | ||
export class EvaluationResult { | ||
status: EvaluationStatus; | ||
@@ -58,3 +58,3 @@ message: string | null; | ||
export function resultToString(result: ExecutionResult): string { | ||
export function resultToString(result: EvaluationResult): string { | ||
return result.toString(); | ||
@@ -122,2 +122,13 @@ } | ||
export function evaluate( | ||
codeData: string, | ||
contextData: string, | ||
storeData: string | ||
): EvaluationResult { | ||
const code = JSON.parse(codeData); | ||
const context = new EvaluationContext(<JSON.Obj>JSON.parse(contextData)); | ||
const store = new EvaluationStore(<JSON.Obj>JSON.parse(storeData)); | ||
return evaluateCode(code, context, store); | ||
} | ||
export function evaluateCode( | ||
@@ -127,4 +138,4 @@ code: VirtualCode, | ||
store: EvaluationStore | ||
): ExecutionResult { | ||
const result = new ExecutionResult(context, store); | ||
): EvaluationResult { | ||
const result = new EvaluationResult(context, store); | ||
if (code === null || code.isNull) { | ||
@@ -131,0 +142,0 @@ result.return = code; |
{ | ||
"name": "@01/as-virtual-code", | ||
"description": "JSON Based Virtual Code Evaluator written in AssemblyScript", | ||
"version": "0.0.1-alpha", | ||
"version": "0.0.1-alpha1", | ||
"types": "assembly/index.ts", | ||
@@ -6,0 +6,0 @@ "private": false, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
150486
4198