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

Commit cd378c0

Browse files
authored
Merge pull request #205 from Alos/compiler-fixes
Made changes to allow compilation with closure compiler
2 parents 3b751d0 + 73d265c commit cd378c0

File tree

7 files changed

+28
-45
lines changed

7 files changed

+28
-45
lines changed

firebase-app.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
/**
9393
* The Firebase app object constructed from the other fields of
9494
* this element.
95+
* @type {firebase.app.App}
9596
*/
9697
app: {
9798
type: Object,

firebase-common-behavior.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
/** @polymerBehavior Polymer.FirebaseCommonBehavior */
1717
Polymer.FirebaseCommonBehaviorImpl = {
1818
properties: {
19+
20+
21+
/**
22+
* @type {!firebase.app.App|undefined}
23+
*/
1924
app: {
2025
type: Object,
2126
notify: true,

firebase-database-behavior.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@
3030

3131
/**
3232
* Path to a Firebase root or endpoint. N.B. `path` is case sensitive.
33+
* @type {string|null}
3334
*/
3435
path: {
3536
type: String,
36-
observer: '__pathChanged',
37-
value: null
37+
value: null,
38+
observer: '__pathChanged'
3839
},
3940

4041
/**
@@ -52,6 +53,10 @@
5253
'__onlineChanged(online)'
5354
],
5455

56+
/**
57+
* Set the firebase value.
58+
* @return {!firebase.Promise<void>}
59+
*/
5560
_setFirebaseValue: function(path, value) {
5661
this._log('Setting Firebase value at', path, 'to', value)
5762
var key = value && value.$key;

firebase-document.html

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,12 @@
4949
}
5050
},
5151

52-
/**
53-
* @override
54-
*/
52+
5553
get isNew() {
5654
return this.disabled || !this.__pathReady(this.path);
5755
},
5856

59-
/**
60-
* @override
61-
*/
57+
6258
get zeroValue() {
6359
return {};
6460
},
@@ -73,11 +69,11 @@
7369
* not given, a random key will be generated and used.
7470
* @return {Promise} A promise that resolves once this.data has been
7571
* written to the new path.
76-
* @override
72+
*
7773
*/
7874
saveValue: function(parentPath, key) {
7975
return new Promise(function(resolve, reject) {
80-
var path;
76+
var path = null;
8177

8278
if (!this.app) {
8379
reject(new Error('No app configured!'));
@@ -102,26 +98,17 @@
10298
}.bind(this));
10399
},
104100

105-
/**
106-
* @override
107-
*/
108101
reset: function() {
109102
this.path = null;
110103
return Promise.resolve();
111104
},
112105

113-
/**
114-
* @override
115-
*/
116106
destroy: function() {
117107
return this._setFirebaseValue(this.path, null).then(function() {
118108
return this.reset();
119109
}.bind(this));
120110
},
121111

122-
/**
123-
* @override
124-
*/
125112
memoryPathToStoragePath: function(path) {
126113
var storagePath = this.path;
127114

@@ -132,9 +119,6 @@
132119
return storagePath;
133120
},
134121

135-
/**
136-
* @override
137-
*/
138122
storagePathToMemoryPath: function(storagePath) {
139123
var path = 'data';
140124

@@ -148,9 +132,6 @@
148132
return path;
149133
},
150134

151-
/**
152-
* @override
153-
*/
154135
getStoredValue: function(path) {
155136
return new Promise(function(resolve, reject) {
156137
this.db.ref(path).once('value', function(snapshot) {
@@ -163,9 +144,6 @@
163144
}.bind(this));
164145
},
165146

166-
/**
167-
* @override
168-
*/
169147
setStoredValue: function(path, value) {
170148
return this._setFirebaseValue(path, value);
171149
},

firebase-messaging.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@
6868
(function() {
6969
var stateMap = {};
7070

71-
function applyAll(app, method) {
71+
/**
72+
*
73+
* @param {Object} app
74+
* @param {string} method
75+
* @param {...*} var_args
76+
*/
77+
function applyAll(app, method, var_args) {
7278
var args = Array.prototype.slice.call(arguments, 2);
7379
stateMap[app.name].instances.forEach(function(el) {
7480
el[method].apply(el, args);
@@ -131,6 +137,7 @@
131137
* The current registration token for this session. Save this
132138
* somewhere server-accessible so that you can target push messages
133139
* to this device.
140+
* @type {String}
134141
*/
135142
token: {
136143
type: String,
@@ -222,7 +229,7 @@
222229
* must be called after initialization to start listening for push
223230
* messages.
224231
*
225-
* @param {ServiceWorkerRegistration} swreg the custom service worker registration with which to activate
232+
* @param {ServiceWorkerRegistration=} swreg the custom service worker registration with which to activate
226233
*/
227234
activate: function(swreg) {
228235
this.statusKnown = false;

firebase-query.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@
179179
return [];
180180
},
181181

182-
/**
183-
* @override
184-
*/
185182
memoryPathToStoragePath: function(path) {
186183
var storagePath = this.path;
187184

@@ -199,9 +196,6 @@
199196
return storagePath;
200197
},
201198

202-
/**
203-
* @override
204-
*/
205199
storagePathToMemoryPath: function(storagePath) {
206200
var path = 'data';
207201

@@ -220,9 +214,6 @@
220214
return path;
221215
},
222216

223-
/**
224-
* @override
225-
*/
226217
setStoredValue: function(storagePath, value) {
227218
if (storagePath === this.path || /\$key$/.test(storagePath)) {
228219
return Promise.resolve();
@@ -276,15 +267,11 @@
276267
return query;
277268
},
278269

279-
/**
280-
* `@override`
281-
*/
282-
283270
__pathChanged: function(path, oldPath) {
284271
// we only need to reset the data if the path is null (will also trigged when this element initiates)
285272
// When path changes and is not null, it triggers a ref change (via __computeRef(db,path)), which then triggers a __queryChanged setting data to zeroValue
286273

287-
if (path == null ) {
274+
if (path == null) {
288275
this.syncToMemory(function() {
289276
this.data = this.zeroValue;
290277
});

firebase-storage-script.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<script src="../firebase/firebase-storage.js"></script>
1+
<script src="../firebase/firebase-storage.js"></script>

0 commit comments

Comments
 (0)