_runStatements()

in web/src/components/playground.js [328:364]


  _runStatements() {
    let state = this.state;
    let payloadType;
    try {
      payloadType = getJsonPayloadType(this.payload);
    } catch (e) {
      this.shadowRoot
        .querySelector('#result-panel')
        .showErrorMessage(`Invalid OTLP JSON payload: ${e}`);
      return;
    }

    // eslint-disable-next-line no-undef
    let result = executeStatements(
      state.config,
      payloadType,
      state.payload,
      state.evaluator
    );

    this.dispatchEvent(
      new CustomEvent('playground-run-result', {
        detail: {
          state: state,
          result: result,
          error:
            result && Object.prototype.hasOwnProperty.call(result, 'error'),
        },
        bubbles: true,
        composed: true,
        cancelable: true,
      })
    );

    this.payload = state.payload;
    this._result = result;
  }