Bug 125059 - jsc: implement a native readFile function
Summary: jsc: implement a native readFile function
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 93702 (view as bug list)
Depends on:
Blocks: 125048
  Show dependency treegraph
 
Reported: 2013-12-01 20:48 PST by Brian Burg
Modified: 2015-12-23 09:58 PST (History)
4 users (show)

See Also:


Attachments
patch (2.68 KB, patch)
2013-12-01 21:01 PST, Brian Burg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Burg 2013-12-01 20:48:01 PST
To run tools like JSHint from the standalone jsc executable (i.e., as a check-webkit-style backend), there needs to be a way able to slurp a file into a string.

Rhino has had a function like this called readFile(). It's pretty simple to implement, as jsc already slurps files and evaluates them with script-exposed run(). I think we can just ignore the character encoding argument, as we don't have any better idea what it should be (or what to do with it) than WTF::String.

https://github.com/mozilla/rhino/blob/5f1ad11dfbf23b3afcc8caa6c230fa3533b5ffd6/toolsrc/org/mozilla/javascript/tools/shell/Global.java#L778
Comment 1 Brian Burg 2013-12-01 21:01:32 PST
Created attachment 218138 [details]
patch
Comment 2 Brian Burg 2013-12-02 07:45:41 PST
Could you set cq+ as well? Thanks!
Comment 3 WebKit Commit Bot 2013-12-02 08:36:11 PST
Comment on attachment 218138 [details]
patch

Clearing flags on attachment: 218138

Committed r159934: <http://trac.webkit.org/changeset/159934>
Comment 4 WebKit Commit Bot 2013-12-02 08:36:12 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Daniel Bates 2015-12-23 09:58:00 PST
*** Bug 93702 has been marked as a duplicate of this bug. ***