Permalink
Browse files

fix uglifier bug

  • Loading branch information...
1 parent 47c7e57 commit 64682b37001a9f14a061485323fbed4110ba82e1 @nick-benoit14 nick-benoit14 committed Jul 20, 2016
Showing with 14 additions and 14 deletions.
  1. +10 −10 lib/recorder.js
  2. +4 −4 src/recorder.js
View
@@ -1,12 +1,12 @@
'use strict';
-var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
-
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Recorder = undefined;
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
var _inlineWorker = require('inline-worker');
var _inlineWorker2 = _interopRequireDefault(_inlineWorker);
@@ -15,7 +15,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var Recorder = exports.Recorder = (function () {
+var Recorder = exports.Recorder = function () {
function Recorder(source, cfg) {
var _this = this;
@@ -56,10 +56,10 @@ var Recorder = exports.Recorder = (function () {
this.worker = new _inlineWorker2.default(function () {
var recLength = 0,
recBuffers = [],
- sampleRate = undefined,
- numChannels = undefined;
+ sampleRate = void 0,
+ numChannels = void 0;
- self.onmessage = function (e) {
+ this.onmessage = function (e) {
switch (e.data.command) {
case 'init':
init(e.data.config);
@@ -97,7 +97,7 @@ var Recorder = exports.Recorder = (function () {
for (var channel = 0; channel < numChannels; channel++) {
buffers.push(mergeBuffers(recBuffers[channel], recLength));
}
- var interleaved = undefined;
+ var interleaved = void 0;
if (numChannels === 2) {
interleaved = interleave(buffers[0], buffers[1]);
} else {
@@ -106,15 +106,15 @@ var Recorder = exports.Recorder = (function () {
var dataview = encodeWAV(interleaved);
var audioBlob = new Blob([dataview], { type: type });
- self.postMessage({ command: 'exportWAV', data: audioBlob });
+ this.postMessage({ command: 'exportWAV', data: audioBlob });
}
function getBuffer() {
var buffers = [];
for (var channel = 0; channel < numChannels; channel++) {
buffers.push(mergeBuffers(recBuffers[channel], recLength));
}
- self.postMessage({ command: 'getBuffer', data: buffers });
+ this.postMessage({ command: 'getBuffer', data: buffers });
}
function clear() {
@@ -273,6 +273,6 @@ var Recorder = exports.Recorder = (function () {
}]);
return Recorder;
-})();
+}();
exports.default = Recorder;
View
@@ -44,7 +44,7 @@ export class Recorder {
sampleRate,
numChannels;
- self.onmessage = function (e) {
+ this.onmessage = function (e) {
switch (e.data.command) {
case 'init':
init(e.data.config);
@@ -91,15 +91,15 @@ export class Recorder {
let dataview = encodeWAV(interleaved);
let audioBlob = new Blob([dataview], {type: type});
- self.postMessage({command: 'exportWAV', data: audioBlob});
+ this.postMessage({command: 'exportWAV', data: audioBlob});
}
function getBuffer() {
let buffers = [];
for (let channel = 0; channel < numChannels; channel++) {
buffers.push(mergeBuffers(recBuffers[channel], recLength));
}
- self.postMessage({command: 'getBuffer', data: buffers});
+ this.postMessage({command: 'getBuffer', data: buffers});
}
function clear() {
@@ -252,4 +252,4 @@ export class Recorder {
}
}
-export default Recorder;
+export default Recorder;

0 comments on commit 64682b3

Please sign in to comment.