Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit eb41f32

Browse files
committed
move static function assertArray() outside of closure so it's only created once.
1 parent 899bf2f commit eb41f32

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/firebase.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,6 @@
212212
}
213213
}
214214

215-
function assertArray(arr) {
216-
if( !angular.isArray(arr) ) {
217-
var type = Object.prototype.toString.call(arr);
218-
throw new Error('arrayFactory must return a valid array that passes ' +
219-
'angular.isArray and Array.isArray, but received "' + type + '"');
220-
}
221-
}
222-
223215
var def = $firebaseUtils.defer();
224216
var array = new ArrayFactory($inst, destroy, def.promise);
225217
var batch = $firebaseUtils.batch();
@@ -267,6 +259,14 @@
267259
init();
268260
}
269261

262+
function assertArray(arr) {
263+
if( !angular.isArray(arr) ) {
264+
var type = Object.prototype.toString.call(arr);
265+
throw new Error('arrayFactory must return a valid array that passes ' +
266+
'angular.isArray and Array.isArray, but received "' + type + '"');
267+
}
268+
}
269+
270270
function SyncObject($inst, ObjectFactory) {
271271
function destroy(err) {
272272
self.isDestroyed = true;

0 commit comments

Comments
 (0)