From b89a7ee8b956c96a1dcee995ea840feddc5d4b27 Mon Sep 17 00:00:00 2001 From: Pierre Frisch Date: Thu, 22 Dec 2011 07:25:50 -0800 Subject: First commit of Ninja to ninja-internal Signed-off-by: Valerio Virgillito --- node_modules/montage/core/exception.js | 95 ++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100755 node_modules/montage/core/exception.js (limited to 'node_modules/montage/core/exception.js') diff --git a/node_modules/montage/core/exception.js b/node_modules/montage/core/exception.js new file mode 100755 index 00000000..4cca326d --- /dev/null +++ b/node_modules/montage/core/exception.js @@ -0,0 +1,95 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +var Montage = require("montage").Montage; +var logger = require("core/logger").logger("exception"); +/** + @module montage/core/exception + @requires montage/core/core + @requires montage/core/logger +*/ +/** + @class module:montage/core/exception.Exception + @extends module:montage/core/core.Montage +*/ +var Exception = exports.Exception = Montage.create(Montage,/** @lends module:montage/core/exception.Exception# */ { +/** + @type {Property} + @default {String} null + */ + message: { + value: null, + serializable: true + }, +/** + @type {Property} + @default {String} null + */ + target: { + value: null, + serializable: true + }, +/** + @type {Property} + @default {Function} null + */ + method: { + value: null, + serializable: true + }, + /** + @function + @param {String} message The message to be initialized. + @returns this.initWithMessageTargetAndMethod(message, null, null) + */ + initWithMessage : { + enumerable: true, + value: function(message) { + return this.initWithMessageTargetAndMethod(message, null, null); + } + }, +/** + @function + @param {String} message The message to be initialized. + @param {String} target The target to be initialized. + @returns this.initWithMessageTargetAndMethod(message, target, null) + */ + initWithMessageAndTarget : { + enumerable: true, + value: function(message, target) { + return this.initWithMessageTargetAndMethod(message, target, null); + } + }, +/** + @function + @param {String} message The message to be initialized. + @param {String} target The target to be initialized. + @param {Function} method The method to be initialized. + @returns itself + */ + initWithMessageTargetAndMethod : { + enumerable: true, + value: function(message, target, method) { + this.message = (typeof message !== 'undefined' ? message : null); + Object.defineProperty(this, "message", {writable: false}); + this.target = (typeof target !== 'undefined' ? target : null); + Object.defineProperty(this, "target", {writable: false}); + this.method = (typeof method !== 'undefined' ? method : null); + Object.defineProperty(this, "method", {writable: false}); + return this; + } + }, +/** + @function + @returns The exception + */ + toString: { + enumerable: false, + value: function() { + return "Exception: " + (message !== null ? message + " " : null) + (target !== null ? target + " " : null) + (method !== null ? method + " " : null); + } + } + +}); -- cgit v1.2.3