-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
When serializing an instance of BillingInfo, a RangeError will be encountered due to the following code:
https://github.com/ceejbot/recurring/blob/master/lib/models/billing-info.js#L53
The class is creating a property getter that points to itself.
An error similar to the following is produced:
"err": {
"message": "Maximum call stack size exceeded",
"name": "RangeError",
"stack": "RangeError: Maximum call stack size exceeded\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:52:43)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)\n at BillingInfo.__defineGetter__ [as account_code] (/var/task/node_modules/recurring/lib/models/billing-info.js:53:19)"
}
Looks like
this.__defineGetter__('account_code', () => {
return this.account_code
})
Should be
this.__defineGetter__('account_code', () => {
return this.properties.account_code
})
Happy to send a PR if this repo is still active.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels