Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1485)

Unified Diff: samples/o3d-webgl/param_object.js

Issue 1745002: Incremental progress toward archive loading in o3d-webgl. Implemented... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/o3d/
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/o3d-webgl/pack.js ('k') | samples/o3d-webgl/raw_data.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/o3d-webgl/param_object.js
===================================================================
--- samples/o3d-webgl/param_object.js (revision 45126)
+++ samples/o3d-webgl/param_object.js (working copy)
@@ -102,13 +102,14 @@
function(param_name, param_type_name) {
if (this.params_[param_name])
return null;
+ param_type_name = o3d.filterTypeName_(param_type_name);
if (!o3d.global.o3d[param_type_name])
throw ('Invalid param type name: ' + param_type_name);
var param = new o3d.global.o3d[param_type_name];
param.gl = this.gl;
param.owner_ = this;
this.params_[param_name] = param;
- return this.params_[param_name];
+ return this.filterResult_(this.params_[param_name]);
};
@@ -120,7 +121,7 @@
*/
o3d.ParamObject.prototype.getParam =
function(param_name) {
- return this.params_[param_name];
+ return this.filterResult_(this.params_[param_name]);
};
@@ -169,4 +170,10 @@
o3d.notImplemented();
};
-
+/**
+ * Filters results, turning 'undefined' into 'null'.
+ * @private
+ */
+o3d.ParamObject.prototype.filterResult_= function(result) {
+ return (result ? result : null);
+};
« no previous file with comments | « samples/o3d-webgl/pack.js ('k') | samples/o3d-webgl/raw_data.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698