Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@glimmer/encoder

Package Overview
Dependencies
Maintainers
11
Versions
243
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@glimmer/encoder - npm Package Compare versions

Comparing version 0.30.3 to 0.30.4

12

dist/amd/es5/glimmer-encoder.js

@@ -10,2 +10,3 @@ define('@glimmer/encoder', ['exports'], function (exports) { 'use strict';

var OPERAND_LEN_MASK = 768;
var MACHINE_MASK = 1024;
var InstructionEncoder = function () {

@@ -20,3 +21,3 @@ function InstructionEncoder(buffer) {

InstructionEncoder.prototype.encode = function encode(type) {
InstructionEncoder.prototype.encode = function encode(type, machine) {
var _this = this;

@@ -28,7 +29,7 @@

for (var _len = arguments.length, operands = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
operands[_key - 1] = arguments[_key];
for (var _len = arguments.length, operands = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
operands[_key - 2] = arguments[_key];
}
this.buffer.push(type | operands.length << ARG_SHIFT);
this.buffer.push(type | machine | operands.length << ARG_SHIFT);
this.typePos = this.buffer.length - 1;

@@ -63,2 +64,3 @@ operands.forEach(function (op) {

exports.OPERAND_LEN_MASK = OPERAND_LEN_MASK;
exports.MACHINE_MASK = MACHINE_MASK;
exports.InstructionEncoder = InstructionEncoder;

@@ -69,2 +71,2 @@

});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2xpbW1lci1lbmNvZGVyLmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9AZ2xpbW1lci9lbmNvZGVyL2xpYi9lbmNvZGVyLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE9wIH0gZnJvbSBcIkBnbGltbWVyL3ZtXCI7XG5cbmV4cG9ydCBjb25zdCBBUkdfU0hJRl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bGF0ZWQgc2xvdCBpbnN0ZWFkIG9mIGEgcmVzZXJ2ZWQgc2xvdC4nKTtcbiAgICB9XG4gIH1cbn1cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBRUEsQUFBTyxJQUFNLFlBQVk7QUFDekIsSUFBTSxXQUEwQjtBQUNoQyxBQUFPLElBQU0sWUFBbUI7QUFDaEMsQUFBTyxJQUFNLFlBQW1CO0FBQ2hDLEFBQU8sSUFBTSxtQkFBbUI7QUFDaEMsQUFBTyxJQUFNLGVBQW1CO0FBSWhDLElBQ0U7Z0NBQW1COzs7YUFBTSxTQUFOO2FBQ1osVUFBRzthQUNOLE9BRm1DOzs7MERBR2hDLE1BQVU7OztZQUNYLE9BQU8sV0FBVztrQkFDZCxJQUFJLHdDQUFzQzs7Ozs7OzthQUc3QyxPQUFPLEtBQU0sT0FBTyxVQUFXLFNBQVMsVUFBVTthQUVsRCxVQUFVLEtBQUssT0FBTyxTQUFTO2lCQUUzQixRQUFRLGNBQ2Y7Z0JBQUksT0FBTyxPQUFPLFlBQVksS0FBSyxVQUFVO3NCQUNyQyxJQUFJLHFDQUFtQzs7a0JBRTFDLE9BQU8sS0FBSzs7YUFHZCxPQUFPLEtBQUssT0FBTzs7OzREQUdsQixTQUNOO2VBQU8sT0FBTywyQkFBZ0I7Ozt3REFHMUIsVUFBa0IsU0FDdEI7WUFBSSxLQUFLLE9BQU8sV0FBVyxPQUFPLENBQUMsR0FBRztpQkFDL0IsT0FBTyxXQUFXLEtBQUs7ZUFDdkI7a0JBQ0MsSUFBSSxNQUFNOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9

@@ -11,2 +11,3 @@ 'use strict';

const OPERAND_LEN_MASK = exports.OPERAND_LEN_MASK = 0b0000001100000000;
const MACHINE_MASK = exports.MACHINE_MASK = 0b0000010000000000;
class InstructionEncoder {

@@ -18,7 +19,7 @@ constructor(buffer) {

}
encode(type, ...operands) {
encode(type, machine, ...operands) {
if (type > TYPE_SIZE) {
throw new Error(`Opcode type over 8-bits. Got ${type}.`);
}
this.buffer.push(type | operands.length << ARG_SHIFT);
this.buffer.push(type | machine | operands.length << ARG_SHIFT);
this.typePos = this.buffer.length - 1;

@@ -45,2 +46,2 @@ operands.forEach(op => {

exports.InstructionEncoder = InstructionEncoder;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jb2Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL2VuY29kZXIvbGliL2VuY29kZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFFTyxNQUFNLEFBQVMsZ0NBQUcsQUFBQyxBQUFDO0FBQzNCLE1BQU0sQUFBUSxXQUFrQixBQUFrQixBQUFDLEFBQ25ELEFBQU07QUFBQyxNQUFNLEFBQVMsZ0NBQVUsQUFBVSxBQUFDLEFBQzNDLEFBQU07QUFBQyxNQUFNLEFBQVMsZ0NBQVUsQUFBa0IsQUFBQyxBQUNuRCxBQUFNO0FBQUMsTUFBTSxBQUFnQiw4Q0FBRyxBQUFrQixBQUFDLEFBSW5ELEFBQU07O2dCQUNlLEFBQWlCLFFBQWpCO2FBQU0sU0FBTixBQUFNLEFBQVcsQUFDcEM7YUFBTyxVQUFHLEFBQUMsQUFBQyxBQUNaO2FBQUksT0FGbUMsQUFBQyxBQUVqQyxBQUFDLEFBQUM7QUFDVCxBQUFNO1dBQUMsQUFBUSxNQUFFLEdBQUcsQUFBbUIsVUFDckMsQUFBRSxBQUFDO1lBQUMsQUFBSSxPQUFHLEFBQVMsQUFBQyxXQUFDLEFBQUMsQUFDckI7a0JBQU0sSUFBSSxBQUFLLEFBQUMsc0NBQWdDLEFBQUksQUFBRyxBQUFDLEFBQUMsQUFDM0QsSUFBQztBQUVELEFBQUk7YUFBQyxBQUFNLE9BQUMsQUFBSS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ckNvZGUoLi4ucHJvZ3JhbSk7XG4gIH1cblxuICBwYXRjaChwb3NpdGlvbjogbnVtYmVyLCBvcGVyYW5kOiBudW1iZXIpIHtcbiAgICBpZiAodGhpcy5idWZmZXJbcG9zaXRpb24gKyAxXSA9PT0gLTEpIHtcbiAgICAgIHRoaXMuYnVmZmVyW3Bvc2l0aW9uICsgMV0gPSBvcGVyYW5kO1xuICAgIH0gZWxzZSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoJ1RyeWluZyB0byBwYXRjaCBvcGVyYW5kIGluIHBvcHVsYXRlZCBzbG90IGluc3RlYWQgb2YgYSByZXNlcnZlZCBzbG90LicpO1xuICAgIH1cbiAgfVxufVxuIl19

@@ -17,2 +17,3 @@ 'use strict';

var OPERAND_LEN_MASK = exports.OPERAND_LEN_MASK = 768;
var MACHINE_MASK = exports.MACHINE_MASK = 1024;
var InstructionEncoder = exports.InstructionEncoder = function () {

@@ -27,3 +28,3 @@ function InstructionEncoder(buffer) {

InstructionEncoder.prototype.encode = function encode(type) {
InstructionEncoder.prototype.encode = function encode(type, machine) {
var _this = this;

@@ -35,7 +36,7 @@

for (var _len = arguments.length, operands = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
operands[_key - 1] = arguments[_key];
for (var _len = arguments.length, operands = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
operands[_key - 2] = arguments[_key];
}
this.buffer.push(type | operands.length << ARG_SHIFT);
this.buffer.push(type | machine | operands.length << ARG_SHIFT);
this.typePos = this.buffer.length - 1;

@@ -65,2 +66,2 @@ operands.forEach(function (op) {

}();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jb2Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL2VuY29kZXIvbGliL2VuY29kZXIudHMiXSwibmFtZXMiO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Bwb3B1bGF0ZWQgc2xvdCBpbnN0ZWFkIG9mIGEgcmVzZXJ2ZWQgc2xvdC4nKTtcbiAgICB9XG4gIH1cbn1cbiJdfQ==

@@ -6,2 +6,3 @@ export const ARG_SHIFT = 8;

export const OPERAND_LEN_MASK = 0b0000001100000000;
export const MACHINE_MASK = 0b0000010000000000;
export class InstructionEncoder {

@@ -13,7 +14,7 @@ constructor(buffer) {

}
encode(type, ...operands) {
encode(type, machine, ...operands) {
if (type > TYPE_SIZE) {
throw new Error(`Opcode type over 8-bits. Got ${type}.`);
}
this.buffer.push(type | operands.length << ARG_SHIFT);
this.buffer.push(type | machine | operands.length << ARG_SHIFT);
this.typePos = this.buffer.length - 1;

@@ -39,2 +40,2 @@ operands.forEach(op => {

}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jb2Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL0BnbGltbWVyL2VuY29kZXIvbGliL2VuY29kZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsQUFBTSxPQUFDLE1BQU0sQUFBUyxZQUFHLEFBQUMsQUFBQztBQUMzQixNQUFNLEFBQVEsV0FBa0IsQUFBa0IsQUFBQztBQUNuRCxBQUFNLE9BQUMsTUFBTSxBQUFTLFlBQVUsQUFBVSxBQUFDO0FBQzNDLEFBQU0sT0FBQyxNQUFNLEFBQVMsWUFBVSxBQUFrQixBQUFDO0FBQ25ELEFBQU0sT0FBQyxNQUFNLEFBQWdCLG1CQUFHLEFBQWtCLEFBQUM7QUFJbkQsQUFBTTtBQUNKLGdCQUFtQixBQUFpQjtBQUFqQixhQUFNLFNBQU4sQUFBTSxBQUFXO0FBQ3BDLGFBQU8sVUFBRyxBQUFDLEFBQUM7QUFDWixhQUFJLE9BQUcsQUFBQyxBQUFDLEFBRjhCO0FBQUM7QUFHeEMsQ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bmQgb3ZlciAxNi1iaXRzLiBHb3QgJHtvcH0uYCk7XG4gICAgICB9XG4gICAgICB0aGlzLmJ1ZmZlci5wdXNoKG9wKTtcbiAgICB9KTtcblxuICAgIHRoaXMuc2l6ZSA9IHRoaXMuYnVmZmVyLmxlbmd0aDtcbiAgfVxuXG4gIGNvbXBhY3QocHJvZ3JhbTogbnVtYmVyW10pIHtcbiAgICByZXR1cm4gU3RyaW5nLmZyb21DaGFyQ29kZSguLi5wcm9ncmFtKTtcbiAgfVxuXG4gIHBhdGNoKHBvc2l0aW9uOiBudW1iZXIsIG9wZXJhbmQ6IG51bWJlcikge1xuICAgIGlmICh0aGlzLmJ1ZmZlcltwb3NpdGlvbiArIDFdID09PSAtMSkge1xuICAgICAgdGhpcy5idWZmZXJbcG9zaXRpb24gKyAxXSA9IG9wZXJhbmQ7XG4gICAgfSBlbHNlIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcignVHJ5aW5nIHRvIHBhdGNoIG9wZXJhbmQgaW4gcG9wdWxhdGVkIHNsb3QgaW5zdGVhZCBvZiBhIHJlc2VydmVkIHNsb3QuJyk7XG4gICAgfVxuICB9XG59XG4iXX0=

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

export var OPERAND_LEN_MASK = 768;
export var MACHINE_MASK = 1024;
export var InstructionEncoder = function () {

@@ -18,3 +19,3 @@ function InstructionEncoder(buffer) {

InstructionEncoder.prototype.encode = function encode(type) {
InstructionEncoder.prototype.encode = function encode(type, machine) {
var _this = this;

@@ -26,7 +27,7 @@

for (var _len = arguments.length, operands = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
operands[_key - 1] = arguments[_key];
for (var _len = arguments.length, operands = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
operands[_key - 2] = arguments[_key];
}
this.buffer.push(type | operands.length << ARG_SHIFT);
this.buffer.push(type | machine | operands.length <<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lciwgb3BlcmFuZDogbnVtYmVyKSB7XG4gICAgaWYgKHRoaXMuYnVmZmVyW3Bvc2l0aW9uICsgMV0gPT09IC0xKSB7XG4gICAgICB0aGlzLmJ1ZmZlcltwb3NpdGlvbiArIDFdID0gb3BlcmFuZDtcbiAgICB9IGVsc2Uge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKCdUcnlpbmcgdG8gcGF0Y2ggb3BlcmFuZCBpbiBwb3B1bGF0ZWQgc2xvdCBpbnN0ZWFkIG9mIGEgcmVzZXJ2ZWQgc2xvdC4nKTtcbiAgICB9XG4gIH1cbn1cbiJdfQ==

@@ -6,2 +6,3 @@ import { Op } from "@glimmer/vm";

export declare const OPERAND_LEN_MASK = 768;
export declare const MACHINE_MASK = 1024;
export declare type Operand = number | (() => number);

@@ -13,5 +14,5 @@ export declare class InstructionEncoder {

size: number;
encode(type: Op, ...operands: Operand[]): void;
encode(type: Op, machine: 0 | typeof MACHINE_MASK, ...operands: Operand[]): void;
compact(program: number[]): string;
patch(position: number, operand: number): void;
}
{
"name": "@glimmer/encoder",
"version": "0.30.3",
"version": "0.30.4",
"repository": "https://github.com/glimmerjs/glimmer-vm/tree/master/packages/@glimmer/encoder",

@@ -5,0 +5,0 @@ "devDependencies": {

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