Bug 93702 - jsc has no facility for loading files as data
Summary: jsc has no facility for loading files as data
Status: RESOLVED DUPLICATE of bug 125059
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-10 02:13 PDT by Michael Herring
Modified: 2015-12-23 09:58 PST (History)
12 users (show)

See Also:


Attachments
Patch (2.49 KB, patch)
2012-08-10 02:23 PDT, Michael Herring
no flags Details | Formatted Diff | Diff
Patch (2.39 KB, patch)
2013-06-20 23:55 PDT, Michael Herring
no flags Details | Formatted Diff | Diff
Patch (2.39 KB, patch)
2013-06-21 00:03 PDT, Michael Herring
msaboff: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Herring 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.
Comment 1 Michael Herring 2012-08-10 02:23:57 PDT
Created attachment 157688 [details]
Patch
Comment 2 Alexey Proskuryakov 2012-08-10 11:08:32 PDT
Would shell functionality help?

cat myfile.js | jsc
Comment 3 Michael Herring 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.
Comment 4 Filip Pizlo 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
Comment 5 Michael Herring 2013-06-20 23:55:47 PDT
Created attachment 205152 [details]
Patch
Comment 6 Michael Herring 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.
Comment 7 Build Bot 2013-06-20 23:58:37 PDT
Comment on attachment 205152 [details]
Patch

Attachment 205152 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/918471
Comment 8 EFL EWS Bot 2013-06-20 23:58:54 PDT
Comment on attachment 205152 [details]
Patch

Attachment 205152 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/857774
Comment 9 EFL EWS Bot 2013-06-21 00:00:20 PDT
Comment on attachment 205152 [details]
Patch

Attachment 205152 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/884437
Comment 10 Early Warning System Bot 2013-06-21 00:01:09 PDT
Comment on attachment 205152 [details]
Patch

Attachment 205152 [details] did not pass qt-ews (qt):
Output: http://webkit-queues.appspot.com/results/876611
Comment 11 Early Warning System Bot 2013-06-21 00:01:29 PDT
Comment on attachment 205152 [details]
Patch

Attachment 205152 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/876610
Comment 12 Michael Herring 2013-06-21 00:03:29 PDT
Created attachment 205154 [details]
Patch
Comment 13 Michael Herring 2013-06-21 00:03:58 PDT
Fixed a typo from an old data type identifier.
Comment 14 Michael Saboff 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.
Comment 15 Daniel Bates 2015-12-23 09:58:00 PST

*** This bug has been marked as a duplicate of bug 125059 ***