Merge lp:~abreu-alexandre/v8-cpp/handle-const-raw-object-storage into lp:v8-cpp

Proposed by Alexandre Abreu
Status: Merged
Merged at revision: 31
Proposed branch: lp:~abreu-alexandre/v8-cpp/handle-const-raw-object-storage
Merge into: lp:v8-cpp
Diff against target: 27 lines (+3/-3)
2 files modified
src/internal/class.h (+1/-1)
tests/functions/test.h (+2/-2)
To merge this branch: bzr merge lp:~abreu-alexandre/v8-cpp/handle-const-raw-object-storage
Reviewer Review Type Date Requested Status
Marcus Tomlinson (community) Approve
Review via email: mp+273466@code.launchpad.net

Commit message

Account for const shared ptr when storing the raw object pointer

Description of the change

Account for const shared ptr when storing the raw object pointer

To post a comment you must log in.
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/internal/class.h'
2--- src/internal/class.h 2015-09-01 09:57:38 +0000
3+++ src/internal/class.h 2015-10-05 20:00:08 +0000
4@@ -109,7 +109,7 @@
5
6 using raw_ptr_class = Class<typename IsSharedPointer<T>::type>;
7 v8::Local<v8::Object> v8_object = raw_ptr_class::instance(isolate_).class_template()->GetFunction()->NewInstance();
8- v8_object->SetAlignedPointerInInternalField(0, object->get());
9+ v8_object->SetAlignedPointerInInternalField(0, (void *) object->get());
10 v8_object->SetAlignedPointerInInternalField(1, &raw_ptr_class::instance(isolate_));
11 v8_object->SetAlignedPointerInInternalField(2, object);
12
13
14=== modified file 'tests/functions/test.h'
15--- tests/functions/test.h 2015-09-18 18:39:43 +0000
16+++ tests/functions/test.h 2015-10-05 20:00:08 +0000
17@@ -46,9 +46,9 @@
18 return v8cpp::from_v8<std::string>(v8::Isolate::GetCurrent(), result);
19 }
20
21- std::shared_ptr<Shared> get_shared()
22+ std::shared_ptr<const Shared> get_shared()
23 {
24- auto s = std::shared_ptr<Shared>(new Shared());
25+ auto s = std::shared_ptr<const Shared>(new Shared());
26 return s;
27 }
28

Subscribers

People subscribed via source and target branches