Skip to content

Commit

Permalink
Functions: Bind passed fetch function (#3853)
Browse files Browse the repository at this point in the history
(cherry picked from commit 53ccf19)
  • Loading branch information
hsubox76 committed Oct 5, 2020
1 parent 6ff9efe commit b6b1fd9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-rings-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/functions': patch
---

Fixes a bug introduced in #3782 that causes callable functions to throw an error in browser extensions.
2 changes: 1 addition & 1 deletion packages-exp/functions-exp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ import { name, version } from '../package.json';

export * from './api';

registerFunctions(fetch);
registerFunctions(fetch.bind(self));
registerVersion(name, version);
2 changes: 1 addition & 1 deletion packages/functions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { registerFunctions } from './src/config';

import { name, version } from './package.json';

registerFunctions(firebase as _FirebaseNamespace, fetch);
registerFunctions(firebase as _FirebaseNamespace, fetch.bind(self));
firebase.registerVersion(name, version);

declare module '@firebase/app-types' {
Expand Down

0 comments on commit b6b1fd9

Please sign in to comment.