From f87d8d0433b4b26e9fdf4129dbd7e9c5f594513a Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Fri, 5 Feb 2016 15:39:11 +0700 Subject: [PATCH] Fix parsing packets from tag in web worker --- src/packet/all_packets.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/packet/all_packets.js b/src/packet/all_packets.js index 5f5b5663..aa63a27e 100644 --- a/src/packet/all_packets.js +++ b/src/packet/all_packets.js @@ -2,7 +2,11 @@ * @requires enums * @module packet */ + +'use strict'; + import enums from '../enums.js'; +import * as packets from './all_packets.js'; // re-import module to parse packets from tag /** @see module:packet/compressed */ export { default as Compressed } from './compressed.js'; @@ -43,7 +47,7 @@ export { default as Trust } from './trust.js'; * @returns {Object} new packet object with type based on tag */ export function newPacketFromTag(tag) { - return new this[packetClassFromTagName(tag)](); + return new packets[packetClassFromTagName(tag)](); } /**