Merge pull request #2115 from delenius/enums

Use objects for enums, not constructor functions
This commit is contained in:
wing328
2016-02-15 10:29:34 +08:00
5 changed files with 19 additions and 29 deletions

View File

@@ -24,24 +24,22 @@ if ( typeof define === "function" && define.amd ) {
});
}
var StatusEnum = function StatusEnum() {
var self = this;
var StatusEnum = {
/**
* @const
*/
self.PLACED = "placed",
PLACED: "placed",
/**
* @const
*/
self.APPROVED = "approved",
APPROVED: "approved",
/**
* @const
*/
self.DELIVERED = "delivered";
DELIVERED: "delivered"
}

View File

@@ -24,24 +24,22 @@ if ( typeof define === "function" && define.amd ) {
});
}
var StatusEnum = function StatusEnum() {
var self = this;
var StatusEnum = {
/**
* @const
*/
self.AVAILABLE = "available",
AVAILABLE: "available",
/**
* @const
*/
self.PENDING = "pending",
PENDING: "pending",
/**
* @const
*/
self.SOLD = "sold";
SOLD: "sold"
}