summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3djs/base.js
diff options
context:
space:
mode:
authorpetersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 22:59:21 +0000
committerpetersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 22:59:21 +0000
commit32bb025b1c29269cfc7183e3a538a30054fce90a (patch)
tree901ceaba4ed0bba3b71613b36d66ee1e21fe7965 /o3d/samples/o3djs/base.js
parent04196d7086c7f8544bf96af7bfecc122d03c02b8 (diff)
downloadchromium_src-32bb025b1c29269cfc7183e3a538a30054fce90a.zip
chromium_src-32bb025b1c29269cfc7183e3a538a30054fce90a.tar.gz
chromium_src-32bb025b1c29269cfc7183e3a538a30054fce90a.tar.bz2
Tidied up types to appease doc generator script for new version of o3djs/math.js. I think this should also fix the currently broken tree.
Review URL: http://codereview.chromium.org/3443007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59745 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples/o3djs/base.js')
-rw-r--r--o3d/samples/o3djs/base.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/o3d/samples/o3djs/base.js b/o3d/samples/o3djs/base.js
index 281f5bc..00c5af8 100644
--- a/o3d/samples/o3djs/base.js
+++ b/o3d/samples/o3djs/base.js
@@ -91,13 +91,16 @@ o3djs.provided_ = [];
* Creates object stubs for a namespace. When present in a file,
* o3djs.provide also indicates that the file defines the indicated
* object.
- * @param {string} name name of the object that this file defines.
+ * @param {string} name Name of the object that this file defines.
+ * @param {boolean} opt_replace Whether to replace existing namespace.
*/
-o3djs.provide = function(name) {
+o3djs.provide = function(name, opt_replace) {
// Ensure that the same namespace isn't provided twice.
- if (o3djs.getObjectByName(name) &&
- !o3djs.implicitNamespaces_[name]) {
- throw 'Namespace "' + name + '" already declared.';
+ if (!opt_replace) {
+ if (o3djs.getObjectByName(name) &&
+ !o3djs.implicitNamespaces_[name]) {
+ throw 'Namespace "' + name + '" already declared.';
+ }
}
var namespace = name;