How to use the @webassemblyjs/ast.isAnonymous function in @webassemblyjs/ast

To help you get started, we’ve selected a few @webassemblyjs/ast examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flaviuse / mern-authentication / client / node_modules / @webassemblyjs / wast-printer / esm / index.js View on Github external
function printGlobal(n, depth) {
  var out = "";
  out += "(";
  out += "global";
  out += space;

  if (n.name != null && isAnonymous(n.name) === false) {
    out += printIdentifier(n.name);
    out += space;
  }

  out += printGlobalType(n.globalType);
  out += space;
  n.init.forEach(function (i) {
    out += printInstruction(i, depth + 1);
  });
  out += ")";
  return out;
}
github xtuc / webassemblyjs / packages / wast-printer / src / index.js View on Github external
function printModuleImportDescr(n: ImportDescr): string {
  let out = "";

  if (n.type === "FuncImportDescr") {
    out += "(";
    out += "func";

    if (isAnonymous(n.id) === false) {
      out += space;
      out += printIdentifier(n.id);
    }

    out += printSignature(n.signature);

    out += ")";
  }

  if (n.type === "GlobalType") {
    out += "(";
    out += "global";
    out += space;

    out += printGlobalType(n);
    out += ")";
github xtuc / webassemblyjs / packages / wast-printer / src / index.js View on Github external
function printLoopInstruction(n: LoopInstruction, depth: number): string {
  let out = "";

  out += "(";
  out += "loop";

  if (n.label != null && isAnonymous(n.label) === false) {
    out += space;
    out += printIdentifier(n.label);
  }

  if (typeof n.resulttype === "string") {
    out += space;

    out += "(";
    out += "result";
    out += space;

    out += n.resulttype;
    out += ")";
  }

  if (n.instr.length > 0) {
github flaviuse / mern-authentication / client / node_modules / @webassemblyjs / wast-printer / esm / index.js View on Github external
function printModuleImportDescr(n) {
  var out = "";

  if (n.type === "FuncImportDescr") {
    out += "(";
    out += "func";

    if (isAnonymous(n.id) === false) {
      out += space;
      out += printIdentifier(n.id);
    }

    out += printSignature(n.signature);
    out += ")";
  }

  if (n.type === "GlobalType") {
    out += "(";
    out += "global";
    out += space;
    out += printGlobalType(n);
    out += ")";
  }
github xtuc / webassemblyjs / packages / wast-printer / src / index.js View on Github external
function printFunc(n: Func, depth: number): string {
  let out = "";

  out += "(";
  out += "func";

  if (n.name != null) {
    if (n.name.type === "Identifier" && isAnonymous(n.name) === false) {
      out += space;
      out += printIdentifier(n.name);
    }
  }

  if (n.signature.type === "Signature") {
    out += printSignature(n.signature);
  } else {
    const index = (n.signature: Index);
    out += space;
    out += "(";
    out += "type";
    out += space;

    out += printIndex(index);
github xtuc / webassemblyjs / packages / wast-printer / src / index.js View on Github external
function printFunc(n: Func, depth: number): string {
  let out = "";

  out += "(";
  out += "func";

  if (n.name != null) {
    if (n.name.type === "Identifier" && isAnonymous(n.name) === false) {
      out += space;
      out += printIdentifier(n.name);
    }
  }

  if (n.signature.type === "Signature") {
    out += printSignature(n.signature);
  } else {
    const index = (n.signature: Index);
    out += space;
    out += "(";
    out += "type";
    out += space;

    out += printIndex(index);
github zc910704 / Vue.js-personal-note / www / day6.1.webpack的url-loader与babel / node_modules / @webassemblyjs / wast-printer / esm / index.js View on Github external
function printGlobal(n, depth) {
  var out = "";
  out += "(";
  out += "global";
  out += space;

  if (n.name != null && isAnonymous(n.name) === false) {
    out += printIdentifier(n.name);
    out += space;
  }

  out += printGlobalType(n.globalType);
  out += space;
  n.init.forEach(function (i) {
    out += printInstruction(i, depth + 1);
  });
  out += ")";
  return out;
}
github xtuc / webassemblyjs / packages / wast-printer / src / index.js View on Github external
function printFuncInstructionArg(n: Object, depth: number): string {
  let out = "";

  if (n.type === "NumberLiteral") {
    out += printNumberLiteral(n);
  }

  if (n.type === "LongNumberLiteral") {
    out += printLongNumberLiteral(n);
  }

  if (n.type === "Identifier" && isAnonymous(n) === false) {
    out += printIdentifier(n);
  }

  if (n.type === "ValtypeLiteral") {
    out += n.name;
  }

  if (n.type === "FloatLiteral") {
    out += printFloatLiteral(n);
  }

  if (isInstruction(n)) {
    out += printInstruction(n, depth + 1);
  }

  return out;
github xtuc / webassemblyjs / packages / wast-printer / src / index.js View on Github external
function printBlockInstruction(n: BlockInstruction, depth: number): string {
  let out = "";

  out += "(";
  out += "block";

  if (n.label != null && isAnonymous(n.label) === false) {
    out += space;
    out += printIdentifier(n.label);
  }

  if (n.instr.length > 0) {
    n.instr.forEach(i => {
      if (compact === false) {
        out += "\n";
      }

      out += indent(depth);
      out += printInstruction(i, depth + 1);
    });

    if (compact === false) {
      out += "\n";
github flaviuse / mern-authentication / client / node_modules / @webassemblyjs / wast-printer / esm / index.js View on Github external
function printIfInstruction(n, depth) {
  var out = "";
  out += "(";
  out += "if";

  if (n.testLabel != null && isAnonymous(n.testLabel) === false) {
    out += space;
    out += printIdentifier(n.testLabel);
  }

  if (typeof n.result === "string") {
    out += space;
    out += "(";
    out += "result";
    out += space;
    out += n.result;
    out += ")";
  }

  if (n.test.length > 0) {
    out += space;
    n.test.forEach(function (i) {