cli.args
Version:
Easy command line arguments handling library for node.js
39 lines (37 loc) • 604 B
JavaScript
/**
* @param {string} prefix
* @constructor
*/
function Product(prefix) {
/**
* @private
* @type {number}
*/
this.prefix_ = prefix;
/**
* @private
* @type {string}
*/
this.type_ = "";
}
/**
* @param {string} newType
*/
Object.defineProperty(Product.prototype, "type_", {
/**
* @return {string}
*/
get: function () {
return this.prefix_ + ": " + this.type_;
},
/**
* @param {string}
*/
set: function (newType) {
this.type_ = newType;
}
});
var tmp = new Product("preprod");
console.log(tmp);
tmp.type_ = "newType test";
console.log(tmp);