diff options
author | petersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-17 22:24:58 +0000 |
---|---|---|
committer | petersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-17 22:24:58 +0000 |
commit | ba5e15b350ba9bdbabca26990066b9c665779bef (patch) | |
tree | 5733d1365aa08f4487ca675d5e6fbaaf5e952265 /o3d/samples/o3d-webgl/param_object.js | |
parent | 7f793e3a983f2153bd812b686b95cd1eeda4fa40 (diff) | |
download | chromium_src-ba5e15b350ba9bdbabca26990066b9c665779bef.zip chromium_src-ba5e15b350ba9bdbabca26990066b9c665779bef.tar.gz chromium_src-ba5e15b350ba9bdbabca26990066b9c665779bef.tar.bz2 |
Fixed a typo in pool code and made comments more google style
Implemented ParamObject.removeParam and ParamObject.copyParams. Minor style change in primitive.js.
Review URL: http://codereview.chromium.org/2083004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47465 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples/o3d-webgl/param_object.js')
-rw-r--r-- | o3d/samples/o3d-webgl/param_object.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/o3d/samples/o3d-webgl/param_object.js b/o3d/samples/o3d-webgl/param_object.js index 27b567e..51e8688d 100644 --- a/o3d/samples/o3d-webgl/param_object.js +++ b/o3d/samples/o3d-webgl/param_object.js @@ -46,7 +46,7 @@ o3d.ParamObject.O3D_PREFIX_ = 'o3d.'; /** * Creates a Param with the given name and type on the ParamObject. * Will fail if a param with the same name already exists. - * + * * @param {string} param_name The name of the Param to be created. * @param {string} param_type_name The type of Param to create. * Valid types are @@ -116,7 +116,7 @@ o3d.ParamObject.prototype.createParam = /** * Searches by name for a Param defined in the object. - * + * * @param {string} param_name Name to search for. * @return {!o3d.Param} The Param with the given name, or null otherwise. */ @@ -153,30 +153,30 @@ o3d.ParamObject.prototype.getParam = /** * Removes a Param from a ParamObject. - * + * * This function will fail if the param does not exist on this ParamObject * or if the param is unremovable. - * + * * @param {!o3d.Param} param param to remove. * @return {boolean} True if the param was removed. */ o3d.ParamObject.prototype.removeParam = function(param) { - o3d.notImplemented(); + o3d.removeFromArray(param, this.params_); }; /** * Gets all the param on this param object. - * + * * Each access to this field gets the entire list, so it is best to get it * just once. For example: - * + * * var params = paramObject.params; * for (var i = 0; i < params.length; i++) { * var param = params[i]; * } - * + * * Note that modifications to this array [e.g. push()] will not affect * the underlying ParamObject, while modifications to the array's members * will affect them. @@ -193,7 +193,9 @@ o3d.ParamObject.prototype.params_ = {}; */ o3d.ParamObject.prototype.copyParams = function(source_param_object) { - o3d.notImplemented(); + for (param in source_param_object.params_) { + this.createParam(param.name, param.className); + } }; |