making expression debug info serializable (#78727)

This commit is contained in:
Peter Pisljar 2020-09-29 11:42:21 +02:00 committed by GitHub
parent 69ac94c4bd
commit bddf8ed64a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View file

@ -18,7 +18,6 @@
*/
import { ExpressionValue, ExpressionValueError } from '../expression_types';
import { ExpressionFunction } from '../../common';
export type ExpressionAstNode =
| ExpressionAstExpression
@ -48,9 +47,9 @@ export interface ExpressionAstFunctionDebug {
success: boolean;
/**
* Reference to the expression function this AST node represents.
* Id of expression function.
*/
fn: ExpressionFunction;
fn: string;
/**
* Input that expression function received as its first argument.

View file

@ -491,7 +491,7 @@ describe('Execution', () => {
await execution.result;
for (const node of execution.state.get().ast.chain) {
expect(node.debug?.fn.name).toBe('add');
expect(node.debug?.fn).toBe('add');
}
});
@ -667,7 +667,7 @@ describe('Execution', () => {
expect(node2.debug).toMatchObject({
success: false,
fn: expect.any(Object),
fn: 'throws',
input: expect.any(Object),
args: expect.any(Object),
error: expect.any(Object),

View file

@ -235,7 +235,7 @@ export class Execution<
const timeEnd: number = now();
(link as ExpressionAstFunction).debug = {
success: true,
fn,
fn: fn.name,
input,
args: resolvedArgs,
output,
@ -253,7 +253,7 @@ export class Execution<
if (this.params.debug) {
(link as ExpressionAstFunction).debug = {
success: false,
fn,
fn: fn.name,
input,
args,
error,