-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: introduce process.release object #2154
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2756,6 +2756,39 @@ void SetupProcessObject(Environment* env, | |
"platform", | ||
OneByteString(env->isolate(), NODE_PLATFORM)); | ||
|
||
// process.release | ||
Local<Object> release = Object::New(env->isolate()); | ||
READONLY_PROPERTY(process, "release", release); | ||
READONLY_PROPERTY(release, "name", OneByteString(env->isolate(), "io.js")); | ||
|
||
// if this is a release build and no explicit base has been set | ||
// substitute the standard release download URL | ||
#ifndef NODE_RELEASE_URLBASE | ||
# if NODE_VERSION_IS_RELEASE | ||
# define NODE_RELEASE_URLBASE "https://iojs.org/download/release/" | ||
# endif | ||
#endif | ||
|
||
#if defined(NODE_RELEASE_URLBASE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we assign a default value above, we longer need this, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, because it changes depending on release type, that's 1/2 the point here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean, the checking here is not necessary, as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @TooTallNate Ah, I overlooked it. Sorry. Thanks for pointing out :-) |
||
# define _RELEASE_URLPFX NODE_RELEASE_URLBASE "v" NODE_VERSION_STRING "/" | ||
# define _RELEASE_URLFPFX _RELEASE_URLPFX "iojs-v" NODE_VERSION_STRING | ||
|
||
READONLY_PROPERTY(release, | ||
"sourceUrl", | ||
OneByteString(env->isolate(), | ||
_RELEASE_URLFPFX ".tar.gz")); | ||
READONLY_PROPERTY(release, | ||
"headersUrl", | ||
OneByteString(env->isolate(), | ||
_RELEASE_URLFPFX "-headers.tar.gz")); | ||
# ifdef _WIN32 | ||
READONLY_PROPERTY(release, | ||
"libUrl", | ||
OneByteString(env->isolate(), | ||
_RELEASE_URLPFX "win-" NODE_ARCH "/iojs.lib")); | ||
# endif | ||
#endif | ||
|
||
// process.argv | ||
Local<Array> arguments = Array::New(env->isolate(), argc); | ||
for (int i = 0; i < argc; ++i) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not mention
name
?