mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[objDefine] fix typo and add docs
This commit is contained in:
parent
4d8ff2f7e6
commit
8d586fc0a0
1 changed files with 5 additions and 1 deletions
|
@ -70,7 +70,11 @@ define(function (require) {
|
|||
var self = this;
|
||||
self.obj = Object.create(this.prototype, self.descs);
|
||||
|
||||
if (!Object.REDEFINE_SUPPORTED && !self.prototype.toJSON) {
|
||||
if (!ObjDefine.REDEFINE_SUPPORTED && !self.prototype.toJSON) {
|
||||
// since we can't redefine properties as enumerable we will
|
||||
// clone the object on serialization and choose which properties
|
||||
// to include or trim manually. This is currently only in use in PhantomJS
|
||||
// due to https://github.com/ariya/phantomjs/issues/11856
|
||||
self.obj.toJSON = function () {
|
||||
return _.transform(self.obj, function (json, val, key) {
|
||||
var desc = self.descs[key];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue