Bug 817387 - Remove last occurences of NS_OVERRIDE; r=ehsan
authorFilippo Cristofoletti <filippo987@gmail.com>
Mon, 14 Jan 2013 15:36:24 -0500
changeset 118790 ae1eb238652bd00bab5678d36a85631aaf461d44
parent 118789 329fbaeaa0d4bffe128572aa3f68a0636cd35cc5
child 118791 fb0dbf0686aedfcbefdf3065026b8bdf3ba342da
push id24180
push useremorley@mozilla.com
push dateTue, 15 Jan 2013 22:58:27 +0000
treeherdermozilla-central@72e34ce7fd92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs817387
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 817387 - Remove last occurences of NS_OVERRIDE; r=ehsan DONTBUILD as this is NPOTB.
config/static-checking-config.mk
xpcom/analysis/override.js
--- a/config/static-checking-config.mk
+++ b/config/static-checking-config.mk
@@ -4,17 +4,16 @@
 
 # The entire tree should be subject to static analysis using the XPCOM
 # script. Additional scripts may be added by specific subdirectories.
 
 DEHYDRA_SCRIPT = $(topsrcdir)/config/static-checking.js
 
 DEHYDRA_MODULES = \
   $(topsrcdir)/xpcom/analysis/final.js \
-  $(topsrcdir)/xpcom/analysis/override.js \
   $(topsrcdir)/xpcom/analysis/must-override.js \
   $(NULL)
 
 TREEHYDRA_MODULES = \
   $(topsrcdir)/xpcom/analysis/outparams.js \
   $(topsrcdir)/xpcom/analysis/stack.js \
   $(topsrcdir)/xpcom/analysis/flow.js \
   $(topsrcdir)/xpcom/analysis/static-init.js \
deleted file mode 100644
--- a/xpcom/analysis/override.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * NS_OVERRIDE may be marked on class methods which are intended to override
- * a method in a base class. If the method is removed or altered in the base
- * class, the compiler will force all subclass overrides to be modified.
- */
-
-/**
- * Generate all the base classes recursively of class `c`.
- */
-function all_bases(c)
-{
-  for each (let b in c.bases) {
-    yield b.type;
-    for (let bb in all_bases(b.type))
-      yield bb;
-  }
-}
-
-function process_decl(d)
-{
-  if (!hasAttribute(d, 'NS_override'))
-    return;
-
-  if (!d.memberOf || !d.isFunction) {
-    error("%s is marked NS_OVERRIDE but is not a class function.".format(d.name), d.loc);
-    return;
-  }
-
-  if (d.isStatic) {
-    error("Marking NS_OVERRIDE on static function %s is meaningless.".format(d.name), d.loc);
-    return;
-  }
-
-  for (let base in all_bases(d.memberOf)) {
-    for each (let m in base.members) {
-      if (m.shortName == d.shortName && signaturesMatch(m, d))
-	return;
-    }
-  }
-
-  error("NS_OVERRIDE function %s does not override a base class method with the same name and signature".format(d.name), d.loc);
-}