From 307a561c10ec56d2441899b66c0990ceec2fae59 Mon Sep 17 00:00:00 2001 From: Michal Michalski Date: Thu, 7 Nov 2019 11:23:03 +0100 Subject: [PATCH] [messaging] Full names for Property' properties. Change-Id: I3ab213ba72f379e9870a7b53b8f7c3ff021b798c Signed-off-by: Michal Michalski --- src/messaging/messaging_api.js | 60 +++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/messaging/messaging_api.js b/src/messaging/messaging_api.js index 395d4a6..e8c66ed 100755 --- a/src/messaging/messaging_api.js +++ b/src/messaging/messaging_api.js @@ -21,9 +21,9 @@ var native = new xwalk.utils.NativeManager(extension); var privUtils_ = xwalk.utils; var Property = { - W: 1 << 0, // WRITABLE - E: 1 << 1, // ENUMERABLE - C: 1 << 2 // CONFIGURABLE + WRITEABLE: 1 << 0, + ENUMERABLE: 1 << 1, + CONFIGURABLE: 1 << 2 }; function addTypeToFilter_(data) { @@ -60,13 +60,13 @@ function propertyFactory_(that, name, value, flags, options) { if (!options.get && !options.set) { options.value = value; } - if ((flags & Property.W) != 0) { + if ((flags & Property.WRITEABLE) != 0) { options.writable = true; } - if ((flags & Property.E) != 0) { + if ((flags & Property.ENUMERABLE) != 0) { options.enumerable = true; } - if ((flags & Property.C) != 0) { + if ((flags & Property.CONFIGURABLE) != 0) { options.configurable = true; } Object.defineProperty(that, name, options); @@ -388,17 +388,17 @@ function MessageInit(data) { if (data === null || typeof data !== 'object') { data = {}; } - propertyFactory_(this, 'subject', data.subject || '', Property.E | Property.W); - propertyFactory_(this, 'to', data.to || [], Property.E | Property.W); - propertyFactory_(this, 'cc', data.cc || [], Property.E | Property.W); - propertyFactory_(this, 'bcc', data.bcc || [], Property.E | Property.W); - propertyFactory_(this, 'plainBody', data.plainBody || '', Property.E | Property.W); - propertyFactory_(this, 'htmlBody', data.htmlBody || '', Property.E | Property.W); + propertyFactory_(this, 'subject', data.subject || '', Property.ENUMERABLE | Property.WRITEABLE); + propertyFactory_(this, 'to', data.to || [], Property.ENUMERABLE | Property.WRITEABLE); + propertyFactory_(this, 'cc', data.cc || [], Property.ENUMERABLE | Property.WRITEABLE); + propertyFactory_(this, 'bcc', data.bcc || [], Property.ENUMERABLE | Property.WRITEABLE); + propertyFactory_(this, 'plainBody', data.plainBody || '', Property.ENUMERABLE | Property.WRITEABLE); + propertyFactory_(this, 'htmlBody', data.htmlBody || '', Property.ENUMERABLE | Property.WRITEABLE); propertyFactory_( this, 'isHighPriority', data.isHighPriority || false, - Property.E | Property.W + Property.ENUMERABLE | Property.WRITEABLE ); } @@ -614,10 +614,10 @@ Messaging.prototype.getMessageServices = function() { function MessageStorage() {} function MessageService(data) { - propertyFactory_(this, 'id', data.id, Property.E); - propertyFactory_(this, 'type', data.type, Property.E); - propertyFactory_(this, 'name', data.name, Property.E); - propertyFactory_(this, 'messageStorage', new MessageStorage(this), Property.E); + propertyFactory_(this, 'id', data.id, Property.ENUMERABLE); + propertyFactory_(this, 'type', data.type, Property.ENUMERABLE); + propertyFactory_(this, 'name', data.name, Property.ENUMERABLE); + propertyFactory_(this, 'messageStorage', new MessageStorage(this), Property.ENUMERABLE); } MessageService.prototype.sendMessage = function() { @@ -1357,24 +1357,24 @@ MessageStorage.prototype.removeChangeListener = function() { }; function MessageConversation(data) { - propertyFactory_(this, 'id', data.id || null, Property.E); - propertyFactory_(this, 'type', data.type || '', Property.E); + propertyFactory_(this, 'id', data.id || null, Property.ENUMERABLE); + propertyFactory_(this, 'type', data.type || '', Property.ENUMERABLE); propertyFactory_( this, 'timestamp', data.timestamp ? new Date(data.timestamp * 1000) : null, - Property.E + Property.ENUMERABLE ); - propertyFactory_(this, 'messageCount', data.messageCount || 0, Property.E); - propertyFactory_(this, 'unreadMessages', data.unreadMessages || 0, Property.E); - propertyFactory_(this, 'preview', data.preview || '', Property.E); - propertyFactory_(this, 'subject', data.subject || '', Property.E); - propertyFactory_(this, 'isRead', data.isRead || false, Property.E); - propertyFactory_(this, 'from', data.from || null, Property.E); - propertyFactory_(this, 'to', data.to || [], Property.E); - propertyFactory_(this, 'cc', data.cc || [], Property.E); - propertyFactory_(this, 'bcc', data.bcc || [], Property.E); - propertyFactory_(this, 'lastMessageId', data.lastMessageId || null, Property.E); + propertyFactory_(this, 'messageCount', data.messageCount || 0, Property.ENUMERABLE); + propertyFactory_(this, 'unreadMessages', data.unreadMessages || 0, Property.ENUMERABLE); + propertyFactory_(this, 'preview', data.preview || '', Property.ENUMERABLE); + propertyFactory_(this, 'subject', data.subject || '', Property.ENUMERABLE); + propertyFactory_(this, 'isRead', data.isRead || false, Property.ENUMERABLE); + propertyFactory_(this, 'from', data.from || null, Property.ENUMERABLE); + propertyFactory_(this, 'to', data.to || [], Property.ENUMERABLE); + propertyFactory_(this, 'cc', data.cc || [], Property.ENUMERABLE); + propertyFactory_(this, 'bcc', data.bcc || [], Property.ENUMERABLE); + propertyFactory_(this, 'lastMessageId', data.lastMessageId || null, Property.ENUMERABLE); } function MessageFolder(data) { -- 2.7.4