Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making expression debug info serializable #78727

Merged
merged 1 commit into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/plugins/expressions/common/ast/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

import { ExpressionValue, ExpressionValueError } from '../expression_types';
import { ExpressionFunction } from '../../common';

export type ExpressionAstNode =
| ExpressionAstExpression
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/expressions/common/execution/execution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
});

Expand Down Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/expressions/common/execution/execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -253,7 +253,7 @@ export class Execution<
if (this.params.debug) {
(link as ExpressionAstFunction).debug = {
success: false,
fn,
fn: fn.name,
input,
args,
error,
Expand Down