瀏覽代碼

Fixed errors

bwhitn 7 年之前
父節點
當前提交
e500cfae75
共有 3 個文件被更改,包括 6 次插入8 次删除
  1. 3 5
      src/core/FlowControl.js
  2. 1 1
      src/core/config/OperationConfig.js
  3. 2 2
      test/tests/operations/FlowControl.js

+ 3 - 5
src/core/FlowControl.js

@@ -173,7 +173,7 @@ const FlowControl = {
             jmpIndex = FlowControl._getLabelIndex(ings[0], state),
             maxJumps = ings[1];
 
-        if (state.numJumps >= maxJumps || jmpIndex == -1) {
+        if (state.numJumps >= maxJumps || jmpIndex === -1) {
             return state;
         }
 
@@ -201,7 +201,7 @@ const FlowControl = {
             jmpIndex = FlowControl._getLabelIndex(ings[2], state),
             maxJumps = ings[3];
 
-        if (state.numJumps >= maxJumps || jmpIndex == -1) {
+        if (state.numJumps >= maxJumps || jmpIndex === -1) {
             return state;
         }
 
@@ -228,7 +228,7 @@ const FlowControl = {
         let index = -1;
         for (let o = 0; o < state.opList.length; o++) {
             let operation = state.opList[o];
-            if (operation.getConfig()["op"] === "Label"){
+            if (operation.getConfig().op === "Label"){
                 let ings = operation.getIngValues();
                 if (name === ings[0]) {
                     index = o;
@@ -240,8 +240,6 @@ const FlowControl = {
     },
 
 
-
-
     /**
      * Return operation.
      *

+ 1 - 1
src/core/config/OperationConfig.js

@@ -184,7 +184,7 @@ const OperationConfig = {
     },
     "Label": {
         module: "Default",
-        description: "Provides a place to write comments within the flow of the recipe. This operation has no computational effect.",
+        description: "Provides a location for for conditional and fixed jumps to jump.",
         inputType: "string",
         outputType: "string",
         flowControl: true,

+ 2 - 2
test/tests/operations/FlowControl.js

@@ -260,8 +260,8 @@ TestRegister.addTests([
         ].join("\n"),
         recipeConfig: [
             {
-               op: "Label",
-               args: ["back to the beginning"],
+                op: "Label",
+                args: ["back to the beginning"],
             },
             {
                 op: "Jump",