Closed
Bug 1290655
Opened 8 years ago
Closed 8 years ago
String.prototype.{search, split, replace} should ignore |null| methods
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
mozilla50
Tracking | Status | |
---|---|---|
firefox47 | --- | unaffected |
firefox48 | --- | unaffected |
firefox49 | --- | affected |
firefox-esr45 | --- | unaffected |
firefox50 | --- | fixed |
People
(Reporter: anba, Assigned: arai)
References
Details
Attachments
(1 file)
5.30 KB,
patch
|
evilpie
:
review+
|
Details | Diff | Splinter Review |
Test case 1: --- r = "a-a".split({[Symbol.split]: null, toString(){ return "-"; }}); print(r); --- Expected: Prints "a,a" Actual: Throws TypeError Test case 2: --- r = "a-a".search({[Symbol.search]: null, toString(){ return "-"; }}); print(r); --- Expected: Prints "1" Actual: Throws TypeError Test case 3: --- r = "a-a".replace({[Symbol.replace]: null, toString(){ return "-"; }}, "+"); print(r); --- Expected: Prints "a+a" Actual: Throws TypeError
Assignee | ||
Comment 1•8 years ago
|
||
somehow I forgot to use GetMethod for search/replace/split, but was using on match ... :P try is running: https://treeherder.mozilla.org/#/jobs?repo=try&revision=16e0e6ce4a45
Assignee: nobody → arai.unmht
Blocks: 887016
Status: NEW → ASSIGNED
status-firefox47:
--- → unaffected
status-firefox48:
--- → unaffected
status-firefox49:
--- → affected
status-firefox-esr45:
--- → unaffected
Assignee | ||
Comment 2•8 years ago
|
||
Attachment #8776296 -
Flags: review?(evilpies)
Comment 3•8 years ago
|
||
Comment on attachment 8776296 [details] [diff] [review] Call GetMethod in String.prototype.{search,replace,split}. Review of attachment 8776296 [details] [diff] [review]: ----------------------------------------------------------------- You could check GetMethod "Step 4. If IsCallable(func) is false, throw a TypeError exception." as well.
Attachment #8776296 -
Flags: review?(evilpies) → review+
Assignee | ||
Comment 4•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d7cca89ce49723337bd50dd04fec86f43096560a Bug 1290655 - Call GetMethod in String.prototype.{search,replace,split}. r=evilpie
Comment 5•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d7cca89ce497
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in
before you can comment on or make changes to this bug.
Description
•