-
Notifications
You must be signed in to change notification settings - Fork 27.1k
fix(http):fix jsonp callbackname is undefined #14270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,10 +70,11 @@ export function main() { | |
| expect(instance).toBeAnInstanceOf(JSONPConnection); | ||
| }); | ||
|
|
||
| it('callback name should not contain dots', () => { | ||
| it('callback name should be a function name', () => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as we saw testing callback name doesn't actually verify anything.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this callback name can be any validate function name, and I think it's enough. What to cause |
||
| const funcNameReg = /^[$A-Za-z_][$A-Za-z_\d]*$/i; | ||
| const domJsonp = new MockBrowserJsonp(); | ||
| const callback: string = domJsonp.requestCallback(domJsonp.nextRequestID()); | ||
| expect(callback.indexOf('.') === -1).toBeTruthy(); | ||
| expect(funcNameReg.test(callback)).toBeTruthy(); | ||
| }); | ||
|
|
||
| describe('JSONPConnection', () => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| // This can only be requested once due to constant method name :( | ||
| __ng_jsonp__.__req0.finished([{"name":"caitp"}]) | ||
| __ng_jsonp____req0_finished([{"name":"caitp"}]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert