Giter VIP home page Giter VIP logo

jsmutate's People

Contributors

clwillingham avatar

Watchers

James Cloos avatar  avatar

jsmutate's Issues

TypeError: Cannot read property 'toString' of undefined

Error caused randomly when mutating code, happens to about 25% of mutations
output as follows (after calling a console.log to print the AST that caused it):

{
  "type": "Program",
  "body": [
    {
      "type": "VariableDeclaration",
      "declarations": [
        {
          "type": "VariableDeclarator",
          "id": {
            "type": "Identifier",
            "name": "x"
          },
          "init": {
            "type": "Literal",
            "value": 7.240571506850836
          }
        }
      ],
      "kind": "var"
    },
    {
      "type": "VariableDeclaration",
      "declarations": [
        {
          "type": "VariableDeclarator",
          "id": {
            "type": "Identifier",
            "name": "y"
          },
          "init": {
            "type": "BinaryExpression",
            "operator": "<<",
            "left": {
              "type": "Literal",
              "value": 6.484141219337814,
              "raw": "6.484141219337814"
            },
            "right": {
              "type": "Identifier",
              "name": "x"
            }
          }
        }
      ],
      "kind": "var"
    },
    {
      "type": "ExpressionStatement",
      "expression": {
        "type": "CallExpression",
        "callee": {
          "type": "MemberExpression",
          "computed": false,
          "object": {
            "type": "Identifier",
            "name": "console"
          },
          "property": {
            "type": "Identifier",
            "name": "log"
          }
        },
        "arguments": [
          {
            "type": "BinaryExpression",
            "left": {
              "type": "Literal",
              "value": 9.950931506579174,
              "raw": "9.950931506579174"
            },
            "right": {
              "type": "BinaryExpression",
              "operator": "&",
              "left": {
                "type": "BinaryExpression",
                "operator": ">>",
                "left": {
                  "type": "Identifier",
                  "name": "x"
                },
                "right": {
                  "type": "Literal",
                  "value": 6.466442730746071
                }
              },
              "right": {
                "type": "Identifier",
                "name": "y"
              }
            }
          }
        ]
      }
    }
  ],
  "sourceType": "script"
}
/home/chris/dev/node/jsmutate/node_modules/escodegen/escodegen.js:555
        rightSource = toSourceNodeWhenNeeded(right).toString();
                                                   ^

TypeError: Cannot read property 'toString' of undefined
    at join (/home/chris/dev/node/jsmutate/node_modules/escodegen/escodegen.js:555:52)
    at CodeGenerator.BinaryExpression (/home/chris/dev/node/jsmutate/node_modules/escodegen/escodegen.js:1854:26)
    at CodeGenerator.generateExpression (/home/chris/dev/node/jsmutate/node_modules/escodegen/escodegen.js:2456:28)
    at CodeGenerator.CallExpression (/home/chris/dev/node/jsmutate/node_modules/escodegen/escodegen.js:1880:34)
    at CodeGenerator.generateExpression (/home/chris/dev/node/jsmutate/node_modules/escodegen/escodegen.js:2456:28)
    at CodeGenerator.ExpressionStatement (/home/chris/dev/node/jsmutate/node_modules/escodegen/escodegen.js:1335:28)
    at CodeGenerator.generateStatement (/home/chris/dev/node/jsmutate/node_modules/escodegen/escodegen.js:2469:33)
    at CodeGenerator.Program (/home/chris/dev/node/jsmutate/node_modules/escodegen/escodegen.js:1717:43)
    at CodeGenerator.generateStatement (/home/chris/dev/node/jsmutate/node_modules/escodegen/escodegen.js:2469:33)
    at generateInternal (/home/chris/dev/node/jsmutate/node_modules/escodegen/escodegen.js:2490:28)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.