diff --git a/mozilla/extensions/python/dom/src/nsPyRuntime.cpp b/mozilla/extensions/python/dom/src/nsPyRuntime.cpp index b5d6355256f..42724732708 100644 --- a/mozilla/extensions/python/dom/src/nsPyRuntime.cpp +++ b/mozilla/extensions/python/dom/src/nsPyRuntime.cpp @@ -68,6 +68,20 @@ nsPythonRuntime::CreateContext(nsIScriptContext **ret) return NS_OK; } +nsresult +nsPythonRuntime::ParseVersion(const nsString &aVersionStr, PRUint32 *aFlags) { + // We ignore the version, but it is safer to fail whenever a version is + // specified, thereby ensuring noone will ever specify a version with + // Python, allowing future semantics to be defined without concern for + // existing behaviour. + if (aVersionStr.IsEmpty()) { + *aFlags = 0; + return NS_OK; + } + NS_ERROR("Don't specify a version for Python"); + return NS_ERROR_UNEXPECTED; + } + NS_METHOD nsPythonRuntime::RegisterSelf(nsIComponentManager* aCompMgr, nsIFile* aPath, diff --git a/mozilla/extensions/python/dom/src/nsPyRuntime.h b/mozilla/extensions/python/dom/src/nsPyRuntime.h index e81684bfb68..f543367910b 100644 --- a/mozilla/extensions/python/dom/src/nsPyRuntime.h +++ b/mozilla/extensions/python/dom/src/nsPyRuntime.h @@ -73,10 +73,8 @@ public: virtual nsresult CreateContext(nsIScriptContext **ret); - virtual nsresult ParseVersion(const nsString &aVersionStr, PRUint32 *flags) { - *flags=0; - return NS_OK; - } + virtual nsresult ParseVersion(const nsString &aVersionStr, PRUint32 *flags); + virtual nsresult LockGCThing(void *object); virtual nsresult UnlockGCThing(void *object);