|
36 | 36 | #include <node_child_process.h> |
37 | 37 | #include <node_constants.h> |
38 | 38 | #include <node_stdio.h> |
39 | | -#include <node_natives.h> |
| 39 | +#include <node_javascript.h> |
40 | 40 | #include <node_version.h> |
41 | 41 | #ifdef HAVE_OPENSSL |
42 | 42 | #include <node_crypto.h> |
@@ -1499,30 +1499,9 @@ static Handle<Value> Binding(const Arguments& args) { |
1499 | 1499 |
|
1500 | 1500 | } else if (!strcmp(*module_v, "natives")) { |
1501 | 1501 | exports = Object::New(); |
1502 | | - // Explicitly define native sources. |
1503 | | - // TODO DRY/automate this? |
1504 | | - exports->Set(String::New("assert"), String::New(native_assert)); |
1505 | | - exports->Set(String::New("buffer"), String::New(native_buffer)); |
1506 | | - exports->Set(String::New("child_process"),String::New(native_child_process)); |
1507 | | - exports->Set(String::New("constants"), String::New(native_constants)); |
1508 | | - exports->Set(String::New("dgram"), String::New(native_dgram)); |
1509 | | - exports->Set(String::New("dns"), String::New(native_dns)); |
1510 | | - exports->Set(String::New("events"), String::New(native_events)); |
1511 | | - exports->Set(String::New("freelist"), String::New(native_freelist)); |
1512 | | - exports->Set(String::New("fs"), String::New(native_fs)); |
1513 | | - exports->Set(String::New("http"), String::New(native_http)); |
1514 | | - exports->Set(String::New("crypto"), String::New(native_crypto)); |
1515 | | - exports->Set(String::New("net"), String::New(native_net)); |
1516 | | - exports->Set(String::New("querystring"), String::New(native_querystring)); |
1517 | | - exports->Set(String::New("repl"), String::New(native_repl)); |
1518 | | - exports->Set(String::New("readline"), String::New(native_readline)); |
1519 | | - exports->Set(String::New("sys"), String::New(native_sys)); |
1520 | | - exports->Set(String::New("url"), String::New(native_url)); |
1521 | | - exports->Set(String::New("util"), String::New(native_util)); |
1522 | | - exports->Set(String::New("path"), String::New(native_path)); |
1523 | | - exports->Set(String::New("string_decoder"), String::New(native_string_decoder)); |
1524 | | - exports->Set(String::New("stream"), String::New(native_stream)); |
| 1502 | + DefineJavaScript(exports); |
1525 | 1503 | binding_cache->Set(module, exports); |
| 1504 | + |
1526 | 1505 | } else { |
1527 | 1506 |
|
1528 | 1507 | return ThrowException(Exception::Error(String::New("No such module"))); |
@@ -1663,7 +1642,7 @@ static void Load(int argc, char *argv[]) { |
1663 | 1642 |
|
1664 | 1643 | TryCatch try_catch; |
1665 | 1644 |
|
1666 | | - Local<Value> f_value = ExecuteString(String::New(native_node), |
| 1645 | + Local<Value> f_value = ExecuteString(String::New(MainSource()), |
1667 | 1646 | String::New("node.js")); |
1668 | 1647 | if (try_catch.HasCaught()) { |
1669 | 1648 | ReportException(try_catch, true); |
|
0 commit comments