Merge lp:~marcustomlinson/v8-cpp/lp-1473163 into lp:v8-cpp

Proposed by Marcus Tomlinson
Status: Merged
Merged at revision: 19
Proposed branch: lp:~marcustomlinson/v8-cpp/lp-1473163
Merge into: lp:v8-cpp
Diff against target: 107 lines (+16/-16)
4 files modified
src/internal/require.h (+12/-12)
src/run.h (+2/-2)
tests/run/scripts/test.js (+1/-1)
tests/run/scripts/test2.js (+1/-1)
To merge this branch: bzr merge lp:~marcustomlinson/v8-cpp/lp-1473163
Reviewer Review Type Date Requested Status
Marcus Tomlinson Pending
Review via email: mp+264835@code.launchpad.net

Commit message

Revert some changes to fix link errors

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/internal/require.h'
--- src/internal/require.h 2015-07-08 09:29:21 +0000
+++ src/internal/require.h 2015-07-15 13:20:57 +0000
@@ -28,8 +28,8 @@
28{28{
2929
30using ModuleInitFunc = void(v8::Handle<v8::Object> exports);30using ModuleInitFunc = void(v8::Handle<v8::Object> exports);
31ModuleInitFunc* node_init_func_;31///!ModuleInitFunc* node_init_func_;
32std::shared_ptr<std::string> v8cpp_script_path_;32///!std::shared_ptr<std::string> v8cpp_script_path_;
3333
34struct NodeModule34struct NodeModule
35{35{
@@ -48,7 +48,7 @@
48 // For now we only know that version 14 works here48 // For now we only know that version 14 works here
49 if (mp->nm_version == 14)49 if (mp->nm_version == 14)
50 {50 {
51 node_init_func_ = mp->nm_register_func;51 ///!node_init_func_ = mp->nm_register_func;
52 }52 }
53 else53 else
54 {54 {
@@ -92,8 +92,8 @@
9292
93inline v8::Local<v8::Object> require(std::string const& module_path)93inline v8::Local<v8::Object> require(std::string const& module_path)
94{94{
95 node_init_func_ = nullptr;95 ///!node_init_func_ = nullptr;
96 std::string script_path = v8cpp_script_path_ ? *v8cpp_script_path_ : "";96 std::string script_path; ///! = v8cpp_script_path_ ? *v8cpp_script_path_ : "";
9797
98 // Try append ".node" to module_path98 // Try append ".node" to module_path
99 std::string suffixed_module_path = script_path + module_path + ".node";99 std::string suffixed_module_path = script_path + module_path + ".node";
@@ -117,12 +117,12 @@
117117
118 v8::Local<v8::Object> exports = v8::Object::New(v8::Isolate::GetCurrent());118 v8::Local<v8::Object> exports = v8::Object::New(v8::Isolate::GetCurrent());
119119
120 if (node_init_func_)120///! if (node_init_func_)
121 {121///! {
122 node_init_func_(exports);122///! node_init_func_(exports);
123 }123///! }
124 else124///! else
125 {125///! {
126 auto v8cpp_init_func = (ModuleInitFunc*)dlsym(module, "init_module");126 auto v8cpp_init_func = (ModuleInitFunc*)dlsym(module, "init_module");
127 if (!v8cpp_init_func)127 if (!v8cpp_init_func)
128 {128 {
@@ -130,7 +130,7 @@
130 }130 }
131131
132 v8cpp_init_func(exports);132 v8cpp_init_func(exports);
133 }133///! }
134134
135 return exports;135 return exports;
136}136}
137137
=== modified file 'src/run.h'
--- src/run.h 2015-07-08 09:29:21 +0000
+++ src/run.h 2015-07-15 13:20:57 +0000
@@ -46,7 +46,7 @@
46 isolate->SetData(0, nullptr);46 isolate->SetData(0, nullptr);
47 isolate->Dispose();47 isolate->Dispose();
4848
49 internal::v8cpp_script_path_.reset();49 ///!internal::v8cpp_script_path_.reset();
50 });50 });
5151
52 // Create an isolate scope.52 // Create an isolate scope.
@@ -70,7 +70,7 @@
70 std::size_t found = filename.find_last_of("/");70 std::size_t found = filename.find_last_of("/");
71 if (found != std::string::npos)71 if (found != std::string::npos)
72 {72 {
73 internal::v8cpp_script_path_ = std::make_shared<std::string>(filename.substr(0, found) + "/");73 ///!internal::v8cpp_script_path_ = std::make_shared<std::string>(filename.substr(0, found) + "/");
74 }74 }
7575
76 module.add_function("require", &internal::require);76 module.add_function("require", &internal::require);
7777
=== modified file 'tests/run/scripts/test.js'
--- tests/run/scripts/test.js 2015-07-08 06:20:26 +0000
+++ tests/run/scripts/test.js 2015-07-15 13:20:57 +0000
@@ -16,6 +16,6 @@
16 * Authored by: Marcus Tomlinson <marcus.tomlinson@canonical.com>16 * Authored by: Marcus Tomlinson <marcus.tomlinson@canonical.com>
17 */17 */
1818
19var module = require("../test-run-module");19var module = require("./test-run-module"); ///! ../
20var test_object = new module.TestClass(1, 2);20var test_object = new module.TestClass(1, 2);
21test_object;21test_object;
2222
=== modified file 'tests/run/scripts/test2.js'
--- tests/run/scripts/test2.js 2015-07-08 06:20:26 +0000
+++ tests/run/scripts/test2.js 2015-07-15 13:20:57 +0000
@@ -21,5 +21,5 @@
21console.log(true, " > ", false);21console.log(true, " > ", false);
22console.log("hello", " ", "there");22console.log("hello", " ", "there");
2323
24var module = require("../test-run-module");24var module = require("./test-run-module"); ///! ../
25new module.TestClass(3, 4);25new module.TestClass(3, 4);

Subscribers

People subscribed via source and target branches

to all changes: