Summary: | jsc-cli should allow scripts to access argv | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Mark Hahnenberg <mhahnenberg> | ||||
Component: | JavaScriptCore | Assignee: | Mark Hahnenberg <mhahnenberg> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 127432 | ||||||
Attachments: |
|
Description
Mark Hahnenberg
2014-01-23 08:43:24 PST
Created attachment 224227 [details]
Patch
Comment on attachment 224227 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=224227&action=review > Tools/jsc-cli/jsc-cli.xcodeproj/project.pbxproj:8 > - classes = { > - }; > - objectVersion = 46; > - objects = { > + archiveVersion = 1; > + classes = { > + }; > + objectVersion = 46; > + objects = { > Goddammit Xcode :) (In reply to comment #2) > (From update of attachment 224227 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=224227&action=review > > > Tools/jsc-cli/jsc-cli.xcodeproj/project.pbxproj:8 > > - classes = { > > - }; > > - objectVersion = 46; > > - objects = { > > + archiveVersion = 1; > > + classes = { > > + }; > > + objectVersion = 46; > > + objects = { > > > > Goddammit Xcode :) Yeah, I dunno what's going on there lol. Comment on attachment 224227 [details]
Patch
Commit queue looks like it's having a bad time, so I'll land manually.
Committed r164134: <http://trac.webkit.org/changeset/164134> Comment on attachment 224227 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=224227&action=review > Tools/jsc-cli/jsc-cli/CLIInstance.m:75 > + [_context[@"ARGV"] setValue:(_baseFile ? _baseFile : @"") atIndex:0]; Nit: You could pull _context[@"ARGV"] out into a local instead of potentially calling it a bunch of times in a loop. I don't think ObjC has any support for optimizing away repeated calls like this. Of course performance right here is not important, but this is a good idiom to get used to for ObjC. (In reply to comment #6) > (From update of attachment 224227 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=224227&action=review > > > Tools/jsc-cli/jsc-cli/CLIInstance.m:75 > > + [_context[@"ARGV"] setValue:(_baseFile ? _baseFile : @"") atIndex:0]; > > Nit: You could pull _context[@"ARGV"] out into a local instead of potentially calling it a bunch of times in a loop. I don't think ObjC has any support for optimizing away repeated calls like this. Of course performance right here is not important, but this is a good idiom to get used to for ObjC. Yeah, that's definitely a good idea. Not only does Obj-C not do a good job optimizing this, but these lookups aren't exactly cheap in the JSC API. |