RESOLVED DUPLICATE of bug 125059 93702
jsc has no facility for loading files as data
https://bugs.webkit.org/show_bug.cgi?id=93702
Summary jsc has no facility for loading files as data
Michael Herring
Reported 2012-08-10 02:13:03 PDT
Using the jsc command-line tool, I have noticed there is no way to load a file other than to evaluate it as JavaScript. It is useful to be able to load a file as text or data, so I have created a patch to add a loadFile(path) function to jsc. The only change is to jsc.cpp, and simply adds the ability to load a file and turn its contents into a JSC string value.
Attachments
Patch (2.49 KB, patch)
2012-08-10 02:23 PDT, Michael Herring
no flags
Patch (2.39 KB, patch)
2013-06-20 23:55 PDT, Michael Herring
no flags
Patch (2.39 KB, patch)
2013-06-21 00:03 PDT, Michael Herring
msaboff: review-
Michael Herring
Comment 1 2012-08-10 02:23:57 PDT
Alexey Proskuryakov
Comment 2 2012-08-10 11:08:32 PDT
Would shell functionality help? cat myfile.js | jsc
Michael Herring
Comment 3 2012-08-10 11:10:53 PDT
It wouldn't be relevant, at least not the example you present, since I don't want to eval or load JavaScript in any way. (Rather, it already does that, and I need something else.) I want to load a file and turn the contents of it into a *string* variable. That's what this patch does.
Filip Pizlo
Comment 4 2012-08-13 15:46:05 PDT
Comment on attachment 157688 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=157688&action=review > Source/JavaScriptCore/ChangeLog:8 > + Added a loadFile function to jsc for file input when testin libraries written in JS. Typo: testin -> testing
Michael Herring
Comment 5 2013-06-20 23:55:47 PDT
Michael Herring
Comment 6 2013-06-20 23:57:07 PDT
Sorry for the insane delay on this. I've corrected the commit message, this should hopefully be ready to go in.
Build Bot
Comment 7 2013-06-20 23:58:37 PDT
EFL EWS Bot
Comment 8 2013-06-20 23:58:54 PDT
EFL EWS Bot
Comment 9 2013-06-21 00:00:20 PDT
Early Warning System Bot
Comment 10 2013-06-21 00:01:09 PDT
Early Warning System Bot
Comment 11 2013-06-21 00:01:29 PDT
Michael Herring
Comment 12 2013-06-21 00:03:29 PDT
Michael Herring
Comment 13 2013-06-21 00:03:58 PDT
Fixed a typo from an old data type identifier.
Michael Saboff
Comment 14 2013-10-31 14:27:04 PDT
Comment on attachment 205154 [details] Patch Looks good. Please rebase this patch for the changes to throwing exceptions since the patch was originally posted and resubmit.
Daniel Bates
Comment 15 2015-12-23 09:58:00 PST
*** This bug has been marked as a duplicate of bug 125059 ***
Note You need to log in before you can comment on or make changes to this bug.