Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: utils/jstypes.js

Issue 29350140: Issue 4353 - Remove non standard for each syntax (Closed)
Patch Set: Removed unused code Created Aug. 24, 2016, 2:40 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/dumpast.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/jstypes.js
diff --git a/utils/jstypes.js b/utils/jstypes.js
deleted file mode 100644
index 7b0716c24bf460a4ddada911c2ce454fdf108825..0000000000000000000000000000000000000000
--- a/utils/jstypes.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * This file presents various methods to create a JS typing system.
- */
-
-function divine_inheritance(clazz, constants) {
- let aliases = {};
- for each (let c in constants) {
- aliases[c.name] = c.init;
- }
-
- // First, do we have a QueryInterface variable?
- if ("QueryInterface" in clazz.variables) {
- // Yes, it's a function, but the variable means that we found a XPCOMUtils
- // utility. This'll be easy!
- let xpcom = clazz.variables.QueryInterface.init;
- assert(xpcom.op == JSOP_CALL && xpcom.kids[0].atom == "generateQI");
-
- if (!clazz.inherits)
- clazz.inherits = [];
- for each (let iface in xpcom.kids[1].kids)
- clazz.inherits.push(iface.atom);
- return;
- }
-
- if ("QueryInterface" in clazz.functions) {
- if (!clazz.inherits)
- clazz.inherits = [];
- function findInterfaces(ast) {
- if (ast.op == JSOP_GETPROP && ast.kids[0]) {
- let check = ast.kids[0];
- if (check.atom == "interfaces" && check.kids[0] &&
- check.kids[0].atom == "Components") {
- clazz.inherits.push(ast.atom);
- }
- }
- }
- visit(clazz.functions.QueryInterface.body, findInterfaces, aliases);
- return;
- }
-}
« no previous file with comments | « utils/dumpast.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld