dolphindb 2.0.511 → 2.0.512

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/browser.js CHANGED
@@ -336,6 +336,7 @@ class DdbObj {
336
336
  case DdbType.string:
337
337
  case DdbType.symbol:
338
338
  case DdbType.code:
339
+ case DdbType.handle:
339
340
  case DdbType.functiondef: {
340
341
  const i_head = type === DdbType.functiondef ? 1 : 0;
341
342
  let i_zero = buf.indexOf(0, i_head);
@@ -394,7 +395,7 @@ class DdbObj {
394
395
  ];
395
396
  }
396
397
  default:
397
- return [0, buf];
398
+ throw new Error(`${DdbType[type] || type} 暂时不支持解析`);
398
399
  }
399
400
  }
400
401
  /** parse: rows, cols, items
@@ -533,6 +534,7 @@ class DdbObj {
533
534
  ];
534
535
  case DdbType.string:
535
536
  case DdbType.symbol:
537
+ case DdbType.handle:
536
538
  case DdbType.code: {
537
539
  let value = new Array(length);
538
540
  let i_head = 0, i_tail = i_head;
@@ -712,6 +714,7 @@ class DdbObj {
712
714
  case DdbType.string:
713
715
  case DdbType.symbol:
714
716
  case DdbType.code:
717
+ case DdbType.handle:
715
718
  return [
716
719
  DdbObj.enc.encode(value),
717
720
  Uint8Array.of(0),
@@ -738,10 +741,8 @@ class DdbObj {
738
741
  const { unit, data } = this.value;
739
742
  return [Int32Array.of(data, unit)];
740
743
  }
741
- case DdbType.handle:
742
- throw new Error('DolphinDB Server 不支持 handle 的反序列化');
743
744
  default:
744
- throw new Error(`${DdbType[type]} 暂时不支持序列化`);
745
+ throw new Error(`${DdbType[type] || type} 暂时不支持序列化`);
745
746
  }
746
747
  case DdbForm.vector:
747
748
  case DdbForm.pair:
@@ -834,6 +835,7 @@ class DdbObj {
834
835
  return [value];
835
836
  case DdbType.string:
836
837
  case DdbType.symbol:
838
+ case DdbType.handle:
837
839
  case DdbType.code: {
838
840
  let bufs = new Array(length * 2);
839
841
  for (let i = 0; i < length; i++) {