瀏覽代碼

merge init-dish & update tests

d98762625 6 年之前
父節點
當前提交
de8c99eceb
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      src/core/Dish.mjs
  2. 2 2
      tests/node/tests/nodeApi.mjs

+ 2 - 2
src/core/Dish.mjs

@@ -36,8 +36,8 @@ class Dish {
      * literal input
      * literal input
      */
      */
     constructor(dishOrInput=null, type = null) {
     constructor(dishOrInput=null, type = null) {
-        this.value = [];
-        this.type = Dish.BYTE_ARRAY;
+        this.value = new ArrayBuffer(0);
+        this.type = Dish.ARRAY_BUFFER;
 
 
         // Case: dishOrInput is dish object
         // Case: dishOrInput is dish object
         if (dishOrInput &&
         if (dishOrInput &&

+ 2 - 2
tests/node/tests/nodeApi.mjs

@@ -331,8 +331,8 @@ TestRegister.addApiTests([
 
 
     it("Composable Dish: Should construct empty dish object", () => {
     it("Composable Dish: Should construct empty dish object", () => {
         const dish = new Dish();
         const dish = new Dish();
-        assert.deepEqual(dish.value, []);
-        assert.strictEqual(dish.type, 0);
+        assert.strictEqual(dish.value.byteLength, new ArrayBuffer(0).byteLength);
+        assert.strictEqual(dish.type, 4);
     }),
     }),
 
 
     it("Composable Dish: constructed dish should have apply prototype functions", () => {
     it("Composable Dish: constructed dish should have apply prototype functions", () => {