From 8db0a2b8991066169d756bd72e546e85526f52fe Mon Sep 17 00:00:00 2001 From: "mhammond%skippinet.com.au" Date: Sun, 11 Sep 2005 14:03:07 +0000 Subject: [PATCH] Fail if a version string is specified, so we can define the semantics later git-svn-id: svn://10.0.0.236/branches/DOM_AGNOSTIC_BRANCH@179984 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/extensions/python/dom/src/nsPyRuntime.cpp | 14 ++++++++++++++ mozilla/extensions/python/dom/src/nsPyRuntime.h | 6 ++---- 2 files changed, 16 insertions(+), 4 deletions(-) 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);