Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1350 from jsantell/854990-detraitify-pagemod
Browse files Browse the repository at this point in the history
Fix Bug 854990: Detraitify Page-Mod, r=@ZER0
  • Loading branch information
jsantell committed Feb 26, 2014
2 parents a0abc9c + 45c6600 commit 58283ea
Show file tree
Hide file tree
Showing 5 changed files with 243 additions and 232 deletions.
2 changes: 1 addition & 1 deletion lib/sdk/content/utils.js
Expand Up @@ -35,8 +35,8 @@ function getAttachEventType(model) {
let when = model.contentScriptWhen;
return requiresAddonGlobal(model) ? 'document-element-inserted' :
when === 'start' ? 'document-element-inserted' :
when === 'end' ? 'load' :
when === 'ready' ? 'DOMContentLoaded' :
when === 'end' ? 'load' :
null;
}
exports.getAttachEventType = getAttachEventType;
Expand Down
13 changes: 8 additions & 5 deletions lib/sdk/deprecated/api-utils.js
Expand Up @@ -11,7 +11,7 @@ const memory = require("./memory");

const { merge } = require("../util/object");
const { union } = require("../util/array");
const { isNil } = require("../lang/type");
const { isNil, isRegExp } = require("../lang/type");

// The possible return values of getTypeOf.
const VALID_TYPES = [
Expand All @@ -23,6 +23,7 @@ const VALID_TYPES = [
"object",
"string",
"undefined",
"regexp"
];

const { isArray } = Array;
Expand All @@ -46,8 +47,8 @@ const { isArray } = Array;
* options.
* is: An array containing any number of the typeof type names. If
* the key's value is none of these types, it fails validation.
* Arrays and null are identified by the special type names
* "array" and "null"; "object" will not match either. No type
* Arrays, null and regexps are identified by the special type names
* "array", "null", "regexp"; "object" will not match either. No type
* coercion is done.
* ok: A function that's passed the key's value. If it returns
* false, the value fails validation.
Expand Down Expand Up @@ -127,15 +128,17 @@ exports.addIterator = function addIterator(obj, keysValsGenerator) {
};
};

// Similar to typeof, except arrays and null are identified by "array" and
// "null", not "object".
// Similar to typeof, except arrays, null and regexps are identified by "array" and
// "null" and "regexp", not "object".
let getTypeOf = exports.getTypeOf = function getTypeOf(val) {
let typ = typeof(val);
if (typ === "object") {
if (!val)
return "null";
if (isArray(val))
return "array";
if (isRegExp(val))
return "regexp";
}
return typ;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/sdk/event/dom.js
Expand Up @@ -8,7 +8,7 @@ module.metadata = {
"stability": "unstable"
};

let { emit, on, off } = require("./core");
let { emit } = require("./core");

// Simple utility function takes event target, event type and optional
// `options.capture` and returns node style event stream that emits "data"
Expand Down

0 comments on commit 58283ea

Please sign in to comment.