Socket
Socket
Sign inDemoInstall

webassemblyjs

Package Overview
Dependencies
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webassemblyjs - npm Package Compare versions

Comparing version 1.8.1 to 1.8.2

2

esm/interpreter/kernel/exec.js

@@ -7,3 +7,3 @@ function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

import Long from "@xtuc/long";
import Long from "long";
import { Memory } from "../runtime/values/memory";

@@ -10,0 +10,0 @@ import { RuntimeError } from "../../errors";

@@ -26,3 +26,3 @@ import * as i32 from "../../runtime/values/i32";

case "eqz":
return createValue(value.eqz());
return i32.createValue(value.eqz());

@@ -29,0 +29,0 @@ case "reinterpret/f32":

@@ -13,3 +13,3 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

import Long from "@xtuc/long";
import Long from "long";
import { Float, typedArrayToArray } from "./number";

@@ -16,0 +16,0 @@ import { i64 } from "./i64";

@@ -7,3 +7,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

import Long from "@xtuc/long";
import Long from "long";

@@ -10,0 +10,0 @@ var _require = require("../../../errors"),

@@ -7,7 +7,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

import Long from "@xtuc/long";
import Long from "long";
var _require = require("../../../errors"),
RuntimeError = _require.RuntimeError;
RuntimeError = _require.RuntimeError; // eslint-disable-next-line no-unused-vars
import { i32, createTrue, createFalse } from "./i32";
var type = "i64";

@@ -20,2 +22,6 @@ export var i64 =

if (!(value instanceof Long)) {
throw new Error('value instanceof Long' + " error: " + (undefined || "unknown"));
}
this._value = value;

@@ -42,2 +48,7 @@ }

value: function div_s(operand) {
{
if (operand._value.isZero()) {
throw new RuntimeError("integer divide by zero");
}
}
return new i64(this._value.div(operand._value));

@@ -48,2 +59,7 @@ }

value: function div_u(operand) {
{
if (operand._value.isZero()) {
throw new RuntimeError("integer divide by zero");
}
}
return new i64(this._value.div(operand._value));

@@ -84,3 +100,8 @@ }

value: function abs() {
throw new RuntimeError("Unsupported operation");
if (this._value.isNegative()) {
// make it positive
return this._value.mul(-1);
}
return this;
}

@@ -90,13 +111,21 @@ }, {

value: function copysign() {
throw new RuntimeError("Unsupported operation");
throw new RuntimeError("Unsupported operation: copysign");
}
}, {
key: "max",
value: function max() {
throw new RuntimeError("Unsupported operation");
value: function max(operand) {
if (this._value.lessThan(operand) === true) {
return operand;
} else {
return this;
}
}
}, {
key: "min",
value: function min() {
throw new RuntimeError("Unsupported operation");
value: function min(operand) {
if (this._value.lessThan(operand) === true) {
return this;
} else {
return operand;
}
}

@@ -106,78 +135,88 @@ }, {

value: function neg() {
throw new RuntimeError("Unsupported operation");
return this._value.neg();
}
}, {
key: "lt_s",
value: function lt_s() {
throw new RuntimeError("Unsupported operation");
value: function lt_s(operand) {
return this._value.toSigned().lt(operand._value.toSigned()) ? createTrue() : createFalse();
}
}, {
key: "lt_u",
value: function lt_u() {
throw new RuntimeError("Unsupported operation");
value: function lt_u(operand) {
return this._value.toUnsigned().lt(operand._value.toUnsigned()) ? createTrue() : createFalse();
}
}, {
key: "le_s",
value: function le_s() {
throw new RuntimeError("Unsupported operation");
value: function le_s(operand) {
return this._value.toSigned().lte(operand._value.toSigned()) ? createTrue() : createFalse();
}
}, {
key: "le_u",
value: function le_u() {
throw new RuntimeError("Unsupported operation");
value: function le_u(operand) {
return this._value.toUnsigned().lte(operand._value.toUnsigned()) ? createTrue() : createFalse();
}
}, {
key: "gt_s",
value: function gt_s() {
throw new RuntimeError("Unsupported operation");
value: function gt_s(operand) {
return this._value.toSigned().gt(operand._value.toSigned()) ? createTrue() : createFalse();
}
}, {
key: "gt_u",
value: function gt_u() {
throw new RuntimeError("Unsupported operation");
value: function gt_u(operand) {
return this._value.toUnsigned().gt(operand._value.toUnsigned()) ? createTrue() : createFalse();
}
}, {
key: "ge_s",
value: function ge_s() {
throw new RuntimeError("Unsupported operation");
value: function ge_s(operand) {
return this._value.toSigned().gte(operand._value.toSigned()) ? createTrue() : createFalse();
}
}, {
key: "ge_u",
value: function ge_u() {
throw new RuntimeError("Unsupported operation");
value: function ge_u(operand) {
return this._value.toUnsigned().gte(operand._value.toUnsigned()) ? createTrue() : createFalse();
}
}, {
key: "rem_s",
value: function rem_s() {
throw new RuntimeError("Unsupported operation");
value: function rem_s(operand) {
{
if (operand._value.isZero()) {
throw new RuntimeError("integer divide by zero");
}
}
return new i64(this._value.rem(operand._value));
}
}, {
key: "rem_u",
value: function rem_u() {
throw new RuntimeError("Unsupported operation");
value: function rem_u(operand) {
{
if (operand._value.isZero()) {
throw new RuntimeError("integer divide by zero");
}
}
return new i64(this._value.rem(operand._value));
}
}, {
key: "shl",
value: function shl() {
throw new RuntimeError("Unsupported operation");
value: function shl(operand) {
return new i64(this._value.shiftLeft(operand._value));
}
}, {
key: "shr_s",
value: function shr_s() {
throw new RuntimeError("Unsupported operation");
value: function shr_s(operand) {
return new i64(this._value.shiftRight(operand._value));
}
}, {
key: "shr_u",
value: function shr_u() {
throw new RuntimeError("Unsupported operation");
value: function shr_u(operand) {
return new i64(this._value.shiftRight(operand._value));
}
}, {
key: "rotl",
value: function rotl() {
throw new RuntimeError("Unsupported operation");
value: function rotl(rotation) {
return new i64(this._value.rotateLeft(rotation._value));
}
}, {
key: "rotr",
value: function rotr() {
throw new RuntimeError("Unsupported operation");
value: function rotr(rotation) {
return new i64(this._value.rotateRight(rotation._value));
}

@@ -187,3 +226,15 @@ }, {

value: function clz() {
throw new RuntimeError("Unsupported operation");
var lead = 0;
var str = this._value.toUnsigned().toString(2);
for (var i = 0, len = str.length; i < len; i++) {
if (str[i] !== "0") {
break;
}
lead++;
}
return new i64(new Long(lead));
}

@@ -193,3 +244,15 @@ }, {

value: function ctz() {
throw new RuntimeError("Unsupported operation");
var count = 0;
var str = this._value.toUnsigned().toString(2);
for (var i = str.length; i <= 0; i--) {
if (str[i] !== "0") {
break;
}
count++;
}
return new i64(new Long(count));
}

@@ -199,3 +262,13 @@ }, {

value: function popcnt() {
throw new RuntimeError("Unsupported operation");
var count = 0;
var str = this._value.toUnsigned().toString(2);
for (var i = str.length; i <= 0; i--) {
if (str[i] !== "0") {
count++;
}
}
return new i64(new Long(count));
}

@@ -205,13 +278,13 @@ }, {

value: function eqz() {
throw new RuntimeError("Unsupported operation");
return this._value.isZero() ? createTrue() : createFalse();
}
}, {
key: "eq",
value: function eq() {
throw new RuntimeError("Unsupported operation");
value: function eq(operand) {
return this.equals(operand) ? createTrue() : createFalse();
}
}, {
key: "ne",
value: function ne() {
throw new RuntimeError("Unsupported operation");
value: function ne(operand) {
return new i32(this.equals(operand) ? 0 : 1);
}

@@ -218,0 +291,0 @@ }, {

@@ -8,3 +8,3 @@ "use strict";

var _long = _interopRequireDefault(require("@xtuc/long"));
var _long = _interopRequireDefault(require("long"));

@@ -11,0 +11,0 @@ var _memory2 = require("../runtime/values/memory");

@@ -42,3 +42,3 @@ "use strict";

case "eqz":
return createValue(value.eqz());
return i32.createValue(value.eqz());

@@ -45,0 +45,0 @@ case "reinterpret/f32":

@@ -13,3 +13,3 @@ "use strict";

var _long = _interopRequireDefault(require("@xtuc/long"));
var _long = _interopRequireDefault(require("long"));

@@ -16,0 +16,0 @@ var _number = require("./number");

@@ -13,3 +13,3 @@ "use strict";

var _long = _interopRequireDefault(require("@xtuc/long"));
var _long = _interopRequireDefault(require("long"));

@@ -16,0 +16,0 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -11,4 +11,6 @@ "use strict";

var _long = _interopRequireDefault(require("@xtuc/long"));
var _long = _interopRequireDefault(require("long"));
var _i = require("./i32");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -23,4 +25,5 @@

var _require = require("../../../errors"),
RuntimeError = _require.RuntimeError;
RuntimeError = _require.RuntimeError; // eslint-disable-next-line no-unused-vars
var type = "i64";

@@ -34,2 +37,6 @@

if (!(value instanceof _long.default)) {
throw new Error('value instanceof Long' + " error: " + (undefined || "unknown"));
}
this._value = value;

@@ -56,2 +63,7 @@ }

value: function div_s(operand) {
{
if (operand._value.isZero()) {
throw new RuntimeError("integer divide by zero");
}
}
return new i64(this._value.div(operand._value));

@@ -62,2 +74,7 @@ }

value: function div_u(operand) {
{
if (operand._value.isZero()) {
throw new RuntimeError("integer divide by zero");
}
}
return new i64(this._value.div(operand._value));

@@ -98,3 +115,8 @@ }

value: function abs() {
throw new RuntimeError("Unsupported operation");
if (this._value.isNegative()) {
// make it positive
return this._value.mul(-1);
}
return this;
}

@@ -104,13 +126,21 @@ }, {

value: function copysign() {
throw new RuntimeError("Unsupported operation");
throw new RuntimeError("Unsupported operation: copysign");
}
}, {
key: "max",
value: function max() {
throw new RuntimeError("Unsupported operation");
value: function max(operand) {
if (this._value.lessThan(operand) === true) {
return operand;
} else {
return this;
}
}
}, {
key: "min",
value: function min() {
throw new RuntimeError("Unsupported operation");
value: function min(operand) {
if (this._value.lessThan(operand) === true) {
return this;
} else {
return operand;
}
}

@@ -120,78 +150,88 @@ }, {

value: function neg() {
throw new RuntimeError("Unsupported operation");
return this._value.neg();
}
}, {
key: "lt_s",
value: function lt_s() {
throw new RuntimeError("Unsupported operation");
value: function lt_s(operand) {
return this._value.toSigned().lt(operand._value.toSigned()) ? (0, _i.createTrue)() : (0, _i.createFalse)();
}
}, {
key: "lt_u",
value: function lt_u() {
throw new RuntimeError("Unsupported operation");
value: function lt_u(operand) {
return this._value.toUnsigned().lt(operand._value.toUnsigned()) ? (0, _i.createTrue)() : (0, _i.createFalse)();
}
}, {
key: "le_s",
value: function le_s() {
throw new RuntimeError("Unsupported operation");
value: function le_s(operand) {
return this._value.toSigned().lte(operand._value.toSigned()) ? (0, _i.createTrue)() : (0, _i.createFalse)();
}
}, {
key: "le_u",
value: function le_u() {
throw new RuntimeError("Unsupported operation");
value: function le_u(operand) {
return this._value.toUnsigned().lte(operand._value.toUnsigned()) ? (0, _i.createTrue)() : (0, _i.createFalse)();
}
}, {
key: "gt_s",
value: function gt_s() {
throw new RuntimeError("Unsupported operation");
value: function gt_s(operand) {
return this._value.toSigned().gt(operand._value.toSigned()) ? (0, _i.createTrue)() : (0, _i.createFalse)();
}
}, {
key: "gt_u",
value: function gt_u() {
throw new RuntimeError("Unsupported operation");
value: function gt_u(operand) {
return this._value.toUnsigned().gt(operand._value.toUnsigned()) ? (0, _i.createTrue)() : (0, _i.createFalse)();
}
}, {
key: "ge_s",
value: function ge_s() {
throw new RuntimeError("Unsupported operation");
value: function ge_s(operand) {
return this._value.toSigned().gte(operand._value.toSigned()) ? (0, _i.createTrue)() : (0, _i.createFalse)();
}
}, {
key: "ge_u",
value: function ge_u() {
throw new RuntimeError("Unsupported operation");
value: function ge_u(operand) {
return this._value.toUnsigned().gte(operand._value.toUnsigned()) ? (0, _i.createTrue)() : (0, _i.createFalse)();
}
}, {
key: "rem_s",
value: function rem_s() {
throw new RuntimeError("Unsupported operation");
value: function rem_s(operand) {
{
if (operand._value.isZero()) {
throw new RuntimeError("integer divide by zero");
}
}
return new i64(this._value.rem(operand._value));
}
}, {
key: "rem_u",
value: function rem_u() {
throw new RuntimeError("Unsupported operation");
value: function rem_u(operand) {
{
if (operand._value.isZero()) {
throw new RuntimeError("integer divide by zero");
}
}
return new i64(this._value.rem(operand._value));
}
}, {
key: "shl",
value: function shl() {
throw new RuntimeError("Unsupported operation");
value: function shl(operand) {
return new i64(this._value.shiftLeft(operand._value));
}
}, {
key: "shr_s",
value: function shr_s() {
throw new RuntimeError("Unsupported operation");
value: function shr_s(operand) {
return new i64(this._value.shiftRight(operand._value));
}
}, {
key: "shr_u",
value: function shr_u() {
throw new RuntimeError("Unsupported operation");
value: function shr_u(operand) {
return new i64(this._value.shiftRight(operand._value));
}
}, {
key: "rotl",
value: function rotl() {
throw new RuntimeError("Unsupported operation");
value: function rotl(rotation) {
return new i64(this._value.rotateLeft(rotation._value));
}
}, {
key: "rotr",
value: function rotr() {
throw new RuntimeError("Unsupported operation");
value: function rotr(rotation) {
return new i64(this._value.rotateRight(rotation._value));
}

@@ -201,3 +241,15 @@ }, {

value: function clz() {
throw new RuntimeError("Unsupported operation");
var lead = 0;
var str = this._value.toUnsigned().toString(2);
for (var i = 0, len = str.length; i < len; i++) {
if (str[i] !== "0") {
break;
}
lead++;
}
return new i64(new _long.default(lead));
}

@@ -207,3 +259,15 @@ }, {

value: function ctz() {
throw new RuntimeError("Unsupported operation");
var count = 0;
var str = this._value.toUnsigned().toString(2);
for (var i = str.length; i <= 0; i--) {
if (str[i] !== "0") {
break;
}
count++;
}
return new i64(new _long.default(count));
}

@@ -213,3 +277,13 @@ }, {

value: function popcnt() {
throw new RuntimeError("Unsupported operation");
var count = 0;
var str = this._value.toUnsigned().toString(2);
for (var i = str.length; i <= 0; i--) {
if (str[i] !== "0") {
count++;
}
}
return new i64(new _long.default(count));
}

@@ -219,13 +293,13 @@ }, {

value: function eqz() {
throw new RuntimeError("Unsupported operation");
return this._value.isZero() ? (0, _i.createTrue)() : (0, _i.createFalse)();
}
}, {
key: "eq",
value: function eq() {
throw new RuntimeError("Unsupported operation");
value: function eq(operand) {
return this.equals(operand) ? (0, _i.createTrue)() : (0, _i.createFalse)();
}
}, {
key: "ne",
value: function ne() {
throw new RuntimeError("Unsupported operation");
value: function ne(operand) {
return new _i.i32(this.equals(operand) ? 0 : 1);
}

@@ -232,0 +306,0 @@ }, {

{
"name": "webassemblyjs",
"version": "1.8.1",
"version": "1.8.2",
"keywords": [

@@ -22,11 +22,11 @@ "webassembly",

"dependencies": {
"@webassemblyjs/ast": "1.8.1",
"@webassemblyjs/helper-compiler": "1.8.1",
"@webassemblyjs/validation": "1.8.1",
"@webassemblyjs/wasm-parser": "1.8.1",
"@webassemblyjs/wast-parser": "1.8.1",
"@xtuc/long": "4.2.1"
"@webassemblyjs/ast": "1.8.2",
"@webassemblyjs/helper-compiler": "1.8.2",
"@webassemblyjs/validation": "1.8.2",
"@webassemblyjs/wasm-parser": "1.8.2",
"@webassemblyjs/wast-parser": "1.8.2",
"long": "git://github.com/dcodeIO/long.js.git#8181a6b50a2a230f0b2a1e4c4093f9b9d19c8b69"
},
"devDependencies": {
"@webassemblyjs/floating-point-hex-parser": "1.8.1",
"@webassemblyjs/floating-point-hex-parser": "1.8.2",
"mamacro": "^0.0.3",

@@ -39,3 +39,3 @@ "wabt": "1.0.0-nightly.20180421"

},
"gitHead": "a2f42245e9b597e3541e0f697253449d60fc4d79"
"gitHead": "02af462b507aa7a24f5d3201178434b181bcdabb"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc