Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Remove the deprecated phantom.scriptName #12529

Closed
ariya opened this issue Sep 1, 2014 · 2 comments
Closed

Remove the deprecated phantom.scriptName #12529

ariya opened this issue Sep 1, 2014 · 2 comments
Assignees
Milestone

Comments

@ariya
Copy link
Owner

ariya commented Sep 1, 2014

The use of phantom.scriptName has been deprecated since System#args was introduce (version 1.5, March 2012). It is time to remove it in the upcoming major version PhantomJS 2.

Any old scripts need to migrate to System#args as shown in this example.

console.log('This script is', phantom.scriptName);
phantom.exit();
var system = require('system');
console.log('This script is', system.args[0]);
phantom.exit();
@ariya ariya self-assigned this Sep 1, 2014
@ariya ariya added this to the Release 2.0 milestone Sep 1, 2014
ariya added a commit that referenced this issue Sep 1, 2014
The use of phantom.scriptName has been deprecated since System#args was
introduce (version 1.5, March 2012). Any old scripts need to migrate to
System#args.

#12529
@ariya ariya closed this as completed Sep 1, 2014
@JamesMGreene
Copy link
Collaborator

It's worth noting that they are not identical values. For system.args[0] to match phantom.scriptName, you also have to account for the directory path.

@ariya
Copy link
Owner Author

ariya commented Sep 1, 2014

@JamesMGreene Good point! We may need to have this documented in the API page.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants