From: Przemyslaw Ciezkowski Date: Tue, 16 Jun 2015 10:21:51 +0000 (+0200) Subject: [KeyManager] Prevent calling constructor as function X-Git-Tag: submit/tizen/20150702.103311^2~2^2~44^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89964416a9324385aa44903894c12e0014273af1;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [KeyManager] Prevent calling constructor as function [Verification] All of these calls should throw exception "Constructor cannot be called as function" tizen.Key(); tizen.Data(); tizen.Certificate(); Fixes tct: Key_exist Change-Id: Id5f2898f405c82e0b1f02f9099edc6de18ad2957 Signed-off-by: Przemyslaw Ciezkowski --- diff --git a/src/keymanager/keymanager_api.js b/src/keymanager/keymanager_api.js index 233b91d5..281c4691 100755 --- a/src/keymanager/keymanager_api.js +++ b/src/keymanager/keymanager_api.js @@ -714,14 +714,17 @@ KeyManager.prototype.verifySignature = function() { // expose only basic constructors tizen.Key = function(name, password, extractable) { + xwalk.utils.validator.isConstructorCall(this, tizen.Key); Key.call(this, name, password, extractable, KeyType.KEY_NONE, ""); }; tizen.Key.prototype = Object.create(Key.prototype); tizen.Certificate = function(name, password, extractable) { + xwalk.utils.validator.isConstructorCall(this, tizen.Certificate); Certificate.call(this, name, password, extractable, ""); }; tizen.Certificate.prototype = Object.create(Certificate.prototype); tizen.Data = function(name, password, extractable) { + xwalk.utils.validator.isConstructorCall(this, tizen.Data); Data.call(this, name, password, extractable, ""); }; tizen.Data.prototype = Object.create(Data.prototype);