1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into devel

This commit is contained in:
jsteemann 2016-05-02 17:43:06 +02:00
commit 3cd4a1d186
3 changed files with 9 additions and 18 deletions

View File

@ -1726,6 +1726,10 @@ if (typeof SYS_OPTIONS !== 'undefined') {
delete global.SYS_OPTIONS; delete global.SYS_OPTIONS;
} }
exports.propertyKeys = (obj) => Object.keys(obj).filter((key) => {
return (key.charAt(0) !== '_' && key.charAt(0) !== '$');
});
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief print /// @brief print

View File

@ -38,26 +38,12 @@
Object.defineProperty(Object.prototype, '_shallowCopy', { Object.defineProperty(Object.prototype, '_shallowCopy', {
get() { get() {
var self = this; return require('internal').propertyKeys(this).reduce((previous, key) => {
return this.propertyKeys.reduce(function (previous, key) { previous[key] = this[key];
previous[key] = self[key];
return previous; return previous;
}, {}); }, {});
} }
}); });
////////////////////////////////////////////////////////////////////////////////
/// @brief returns the property keys
////////////////////////////////////////////////////////////////////////////////
Object.defineProperty(Object.prototype, 'propertyKeys', {
get() {
return Object.keys(this).filter(function (key) {
return (key.charAt(0) !== '_' && key.charAt(0) !== '$');
});
}
});
}()); }());

View File

@ -28,6 +28,7 @@
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
var is = require("@arangodb/is"), var is = require("@arangodb/is"),
internal = require("internal"),
Edge, Edge,
Graph, Graph,
Vertex, Vertex,
@ -244,7 +245,7 @@ Edge.prototype.getProperty = function (name) {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Edge.prototype.getPropertyKeys = function () { Edge.prototype.getPropertyKeys = function () {
return this._properties.propertyKeys; return internal.propertyKeys(this._properties);
}; };
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -431,7 +432,7 @@ Vertex.prototype.getProperty = function (name) {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Vertex.prototype.getPropertyKeys = function () { Vertex.prototype.getPropertyKeys = function () {
return this._properties.propertyKeys; return internal.propertyKeys(this._properties);
}; };
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////