mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +08:00
fix(core): make properties enumerable
This commit is contained in:
parent
25d5169251
commit
a151295654
@ -259,6 +259,7 @@ export function CordovaInstance(opts: any = {}) {
|
|||||||
*/
|
*/
|
||||||
export function CordovaProperty(target: any, key: string) {
|
export function CordovaProperty(target: any, key: string) {
|
||||||
Object.defineProperty(target, key, {
|
Object.defineProperty(target, key, {
|
||||||
|
enumerable: true,
|
||||||
get: () => {
|
get: () => {
|
||||||
if (checkAvailability(target, key) === true) {
|
if (checkAvailability(target, key) === true) {
|
||||||
return getPlugin(target.constructor.getPluginRef())[key];
|
return getPlugin(target.constructor.getPluginRef())[key];
|
||||||
@ -282,6 +283,7 @@ export function CordovaProperty(target: any, key: string) {
|
|||||||
*/
|
*/
|
||||||
export function InstanceProperty(target: any, key: string) {
|
export function InstanceProperty(target: any, key: string) {
|
||||||
Object.defineProperty(target, key, {
|
Object.defineProperty(target, key, {
|
||||||
|
enumerable: true,
|
||||||
get: function(){
|
get: function(){
|
||||||
return this._objectInstance[key];
|
return this._objectInstance[key];
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user