Skip to content

Commit 6935085

Browse files
committed
WIP: fix data spec tests
1 parent 71c8625 commit 6935085

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/database.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { Query } from "./database/api/Query";
2121
import { Reference } from "./database/api/Reference";
2222
import { enableLogging } from "./database/core/util/util";
2323
import { RepoManager } from "./database/core/RepoManager";
24+
import * as INTERNAL from './database/api/internal';
2425

2526
export function registerDatabase(instance) {
2627
// Register the Database Service with the 'firebase' namespace.
@@ -33,6 +34,7 @@ export function registerDatabase(instance) {
3334
Query,
3435
Database,
3536
enableLogging,
37+
INTERNAL,
3638
ServerValue: Database.ServerValue,
3739
}
3840
);

src/database/core/snap/nodeFromJSON.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ export function nodeFromJSON(json, priority?) {
2222
return ChildrenNode.EMPTY_NODE;
2323
}
2424

25-
var priority = null;
25+
priority = priority || null;
2626
if (typeof json === 'object' && '.priority' in json) {
2727
priority = json['.priority'];
28-
} else if (typeof priority !== 'undefined') {
29-
priority = priority;
3028
}
29+
3130
assert(
3231
priority === null ||
3332
typeof priority === 'string' ||
@@ -79,7 +78,7 @@ export function nodeFromJSON(json, priority?) {
7978
} else {
8079
var node = ChildrenNode.EMPTY_NODE;
8180
var jsonObj = /** @type {!Object} */ (json);
82-
forEach(jsonObj, function(childData, key) {
81+
forEach(jsonObj, function(key, childData) {
8382
if (contains(jsonObj, key)) {
8483
if (key.substring(0, 1) !== '.') { // ignore metadata nodes.
8584
var childNode = nodeFromJSON(childData);

src/utils/Sha1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export class Sha1 extends Hash {
185185
return;
186186
}
187187

188-
if (opt_length === 'undefined') {
188+
if (opt_length === undefined) {
189189
opt_length = bytes.length;
190190
}
191191

0 commit comments

Comments
 (0)