@ives_xxz/framework 1.2.4 → 1.2.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ives_xxz/framework",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "cocoscreator 2.x mvc framework",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -170,7 +170,7 @@ export default class FWSocket implements FW.Socket {
170
170
  return;
171
171
  }
172
172
 
173
- this.socket.close();
173
+ this.socket?.close();
174
174
  this.socket = null;
175
175
 
176
176
  this.createSocket(this.address, this.tag, this.sender, this.handle, {
package/utils/FWTask.ts CHANGED
@@ -20,13 +20,13 @@ export default class FWTask implements FW.Task {
20
20
 
21
21
  readonly id: number;
22
22
 
23
- constructor(options?: Partial<FW.TaskOptions>) {
24
- this.id = options?.taskId || 0;
23
+ constructor(options: FW.TaskOptions) {
24
+ this.id = options.taskId || Date.now();
25
25
  this.taskCounter = 0;
26
26
  this.totalTaskDuration = 0;
27
- this.log = options?.log ?? true;
28
- this.frameBudget = options?.frameBudget ?? 16;
29
- this.tasksFrameCount = options?.tasksFrameCount ?? 3;
27
+ this.log = options.log ?? true;
28
+ this.frameBudget = options.frameBudget ?? 16;
29
+ this.tasksFrameCount = options.tasksFrameCount ?? 3;
30
30
  this.performanceData = {
31
31
  frameTimes: [],
32
32
  detailedFrames: [],
@@ -138,13 +138,11 @@ export default class FWTask implements FW.Task {
138
138
  });
139
139
  }
140
140
 
141
- if ((result?.value as any)?.message) {
142
- frameTasks.push({
143
- taskId: taskId,
144
- result: result.done ? FWEventDefine.TaskEvent.COMPLETE : FWEventDefine.TaskEvent.YIELDED,
145
- message: (result?.value as any)?.message,
146
- });
147
- }
141
+ frameTasks.push({
142
+ taskId: taskId,
143
+ result: result.done ? FWEventDefine.TaskEvent.COMPLETE : FWEventDefine.TaskEvent.YIELDED,
144
+ message: (result?.value as any)?.message,
145
+ });
148
146
 
149
147
  processed++;
150
148
  }