소스 검색

pass full dish into NodeDish Apply to allow apply from ArrayBuffer type to work

d98762625 6 년 전
부모
커밋
b98cab7d62
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/node/NodeDish.mjs

+ 2 - 2
src/node/NodeDish.mjs

@@ -25,8 +25,8 @@ class NodeDish extends Dish {
         // NOT Buffer.buff, as this makes a buffer of the whole object.
         if (Buffer.isBuffer(inputOrDish)) {
             inputOrDish = new Uint8Array(inputOrDish).buffer;
+            type = Dish.BYTE_ARRAY;
         }
-
         super(inputOrDish, type);
     }
 
@@ -38,7 +38,7 @@ class NodeDish extends Dish {
      * @returns {Dish} a new dish with the result of the operation.
      */
     apply(operation, args=null) {
-        return operation(this.value, args);
+        return operation(this, args);
     }
 
     /**