diff --git a/src/main/js/protobufUtils/classCreator.js b/src/main/js/protobufUtils/classCreator.js index ede29bf..722f1d3 100644 --- a/src/main/js/protobufUtils/classCreator.js +++ b/src/main/js/protobufUtils/classCreator.js @@ -30,7 +30,7 @@ define([], function () { var callParent = function () { if (arguments.length >= 1) { - Parent.apply(this, Array.prototype.slice.call(arguments, 0)); + Parent.apply(this, arguments); } else { Parent.apply(this); } @@ -48,7 +48,7 @@ define([], function () { // special setting this.superConstructor = parentConstructor; // console.log('Setting parent constructor' + parent); - callParent.bind(this)(arguments); + callParent.bind(this).apply(this, arguments); // console.log('Setting back to current constructor' + // localConstructor); this.superConstructor = localConstructor; @@ -58,7 +58,7 @@ define([], function () { * SuperConstructor. */ localScope.prototype.superConstructor = function () { - callParent.bind(this)(arguments); + callParent.bind(this).apply(this, arguments); }; } }; diff --git a/src/main/js/protobufUtils/sketchProtoConverter.js b/src/main/js/protobufUtils/sketchProtoConverter.js index 0d07d74..bebdfe5 100644 --- a/src/main/js/protobufUtils/sketchProtoConverter.js +++ b/src/main/js/protobufUtils/sketchProtoConverter.js @@ -46,7 +46,7 @@ define(['./../sketchLibrary/ProtoSketchFramework', // ProtoSketchFramework throw new ProtobufDecodingException('Data type is not supported:' + typeof data); } - if (protobufUtils.isUndefined(proto) || proto === null || typeof proto !== 'object') { + if (protobufUtils.isUndefined(proto) || proto === null) { throw new ProtobufDecodingException('Proto is not a valid object:' + typeof proto); } try { @@ -220,7 +220,7 @@ define(['./../sketchLibrary/ProtoSketchFramework', // ProtoSketchFramework */ var createNewSketch = function createNewSketch(id, x, y, width, height) { var command = createBaseCommand(Commands.CommandType.CREATE_SKETCH, false); - var idChain = sketchUtil.IdChain(); + var idChain = new sketchUtil.IdChain(); if (!protobufUtils.isUndefined(id)) { idChain.idChain = [ id ]; } else { diff --git a/src/main/js/sketchLibrary/SketchLibraryException.js b/src/main/js/sketchLibrary/SketchLibraryException.js index 9b98e18..2765c19 100644 --- a/src/main/js/sketchLibrary/SketchLibraryException.js +++ b/src/main/js/sketchLibrary/SketchLibraryException.js @@ -12,7 +12,6 @@ define(['stacktrace-js'], function (StackTrace) { * @constructor */ function SketchLibraryException(message, cause) { - this.name = 'SketchLibraryException'; /** * The level defines how bad it is. level 5 is the okayest exception @@ -37,7 +36,7 @@ define(['stacktrace-js'], function (StackTrace) { * of the the exception that occurred. */ this.setMessage = function(messageValue) { - this.specificMessage = messageValue; + this.message = messageValue; }; /**