From 5ced8e655d46e1238de838f4e1855b57639bfd10 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 18 Nov 2015 12:14:00 -0800 Subject: [PATCH] [bug] #317 Added jsdoc note about performance --- platform/core/src/types/TypeImpl.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/core/src/types/TypeImpl.js b/platform/core/src/types/TypeImpl.js index 1a9854ea74..333f37663f 100644 --- a/platform/core/src/types/TypeImpl.js +++ b/platform/core/src/types/TypeImpl.js @@ -156,6 +156,13 @@ define( }); }; + /** + * Returns the default model for an object of this type. Note that + * this method returns a clone of the original model, so if using this + * method heavily, consider caching the result to optimize performance. + * + * @return {object} The default model for an object of this type. + */ TypeImpl.prototype.getInitialModel = function () { return JSON.parse(JSON.stringify(this.typeDef.model || {})); };