Commit 745cccdc authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Fix developer shell build on Windows.

Fixed the OS check in the SCons build. Moved SetEnvironment to platform file as Windows does not have setenv. Added the d8-windows.cc to the Visual Studio project.
Review URL: http://codereview.chromium.org/57050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1649 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1f7a7d9c
...@@ -95,7 +95,7 @@ D8_FILES = { ...@@ -95,7 +95,7 @@ D8_FILES = {
'os:freebsd': [ 'os:freebsd': [
'd8-posix.cc' 'd8-posix.cc'
], ],
'os:windows': [ 'os:win32': [
'd8-windows.cc' 'd8-windows.cc'
], ],
'os:nullos': [ 'os:nullos': [
......
...@@ -538,4 +538,26 @@ Handle<Value> Shell::ChangeDirectory(const Arguments& args) { ...@@ -538,4 +538,26 @@ Handle<Value> Shell::ChangeDirectory(const Arguments& args) {
} }
Handle<Value> Shell::SetEnvironment(const Arguments& args) {
if (args.Length() != 2) {
const char* message = "setenv() takes two arguments";
return ThrowException(String::New(message));
}
String::Utf8Value var(args[0]);
String::Utf8Value value(args[1]);
if (*var == NULL) {
const char* message =
"os.setenv(): String conversion of variable name failed.";
return ThrowException(String::New(message));
}
if (*value == NULL) {
const char* message =
"os.setenv(): String conversion of variable contents failed.";
return ThrowException(String::New(message));
}
setenv(*var, *value, 1);
return v8::Undefined();
}
} // namespace v8 } // namespace v8
...@@ -49,4 +49,11 @@ Handle<Value> Shell::ChangeDirectory(const Arguments& args) { ...@@ -49,4 +49,11 @@ Handle<Value> Shell::ChangeDirectory(const Arguments& args) {
} }
Handle<Value> Shell::SetEnvironment(const Arguments& args) {
Handle<String> error_message =
String::New("setenv() is not yet supported on your OS");
return ThrowException(error_message);
}
} // namespace v8 } // namespace v8
...@@ -163,28 +163,6 @@ Handle<Value> Shell::Print(const Arguments& args) { ...@@ -163,28 +163,6 @@ Handle<Value> Shell::Print(const Arguments& args) {
} }
Handle<Value> Shell::SetEnvironment(const Arguments& args) {
if (args.Length() != 2) {
const char* message = "setenv() takes two arguments";
return ThrowException(String::New(message));
}
String::Utf8Value var(args[0]);
String::Utf8Value value(args[1]);
if (*var == NULL) {
const char* message =
"os.setenv(): String conversion of variable name failed.";
return ThrowException(String::New(message));
}
if (*value == NULL) {
const char* message =
"os.setenv(): String conversion of variable contents failed.";
return ThrowException(String::New(message));
}
setenv(*var, *value, 1);
return v8::Undefined();
}
Handle<Value> Shell::Load(const Arguments& args) { Handle<Value> Shell::Load(const Arguments& args) {
for (int i = 0; i < args.Length(); i++) { for (int i = 0; i < args.Length(); i++) {
HandleScope handle_scope; HandleScope handle_scope;
......
...@@ -157,6 +157,10 @@ ...@@ -157,6 +157,10 @@
RelativePath="..\..\src\d8-debug.h" RelativePath="..\..\src\d8-debug.h"
> >
</File> </File>
<File
RelativePath="..\..\src\d8-windows.cc"
>
</File>
<File <File
RelativePath="..\..\src\d8.js" RelativePath="..\..\src\d8.js"
> >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment