@lcap/nasl 3.3.0-alpha.3 → 3.4.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -128,18 +128,18 @@ function getMiniAppChange(target: any, obj: any, action: string) {
128
128
  }
129
129
 
130
130
  let aiExecuted = 0;
131
- let sessionId = '';
131
+ let sessionPath = '';
132
132
  // AI 生成内容是否被采纳
133
133
  const handleAIPoint = (app: any, actionItem: any) => {
134
134
  const { actionMsg, action } = actionItem || {};
135
135
  if (aiExecuted > 0) {
136
- app.emit('logic:accepted', { ...actionItem, sessionId });
136
+ app.emit('logic:accepted', { ...actionItem, sessionPath });
137
137
  aiExecuted -= 1;
138
138
  }
139
139
  if (actionMsg.includes('自然语言生成代码') && !action) {
140
140
  aiExecuted += 1;
141
141
  // eslint-disable-next-line prefer-destructuring
142
- sessionId = actionMsg.match(/:(.*)/)[1];
142
+ sessionPath = actionMsg.match(/:(.*)/)[1];
143
143
  }
144
144
  }
145
145
 
@@ -92,7 +92,7 @@ export function withSourceMap() {
92
92
  } catch (err) {}
93
93
  if (!state) {
94
94
  // 没有状态不生成 SourceMap
95
- return oldMethod.call(this);
95
+ return oldMethod.call(this, state, ...args);
96
96
  }
97
97
  // state = Object.freeze(Object.assign({
98
98
  // position: { line: 0, character: 0, offset: 0 },
@@ -33,7 +33,7 @@ export interface TimeSlicingOption {
33
33
  */
34
34
  export function timeSlicing<T>(list: T[], cb: (val: T, index: number) => void, opt: Partial<TimeSlicingOption> = {}): Promise<void> {
35
35
  // node 环境不需要进行切片
36
- if (process.env.BUILD_TARGET === 'node') {
36
+ if (process.env.BUILD_TARGET === 'node' || !globalThis.window) {
37
37
  list.forEach((item, i) => cb(item, i));
38
38
  return;
39
39
  }