Bug 1200798 - refactor sources and breakpoints in debugger to use redux r=ejpbruel

This commit is contained in:
James Long
2015-11-25 19:41:26 -05:00
parent b316c2fe7f
commit bc08c20fd9
131 changed files with 6389 additions and 6686 deletions

View File

@@ -124,7 +124,7 @@ exports.zip = function zip(a, b) {
/**
* Converts an object into an array with 2-element arrays as key/value
* pairs of the object. `{ foo: 1, bar: 2}` would become
* `[[foo, 1], [bar 2]]` (order not guaranteed);
* `[[foo, 1], [bar 2]]` (order not guaranteed).
*
* @param object obj
* @returns array
@@ -133,6 +133,18 @@ exports.entries = function entries(obj) {
return Object.keys(obj).map(k => [k, obj[k]]);
}
/*
* Takes an array of 2-element arrays as key/values pairs and
* constructs an object using them.
*/
exports.toObject = function(arr) {
const obj = {};
for(let pair of arr) {
obj[pair[0]] = pair[1];
}
return obj;
}
/**
* Takes an array of 2-element arrays as key/values pairs and
* constructs an object using them.