Enable modifying existing ObjectTemplate.
This commit is contained in:
parent
4cada31f80
commit
6ac926aa32
2 changed files with 7 additions and 3 deletions
|
@ -6,8 +6,10 @@
|
||||||
|
|
||||||
namespace mate {
|
namespace mate {
|
||||||
|
|
||||||
ObjectTemplateBuilder::ObjectTemplateBuilder(v8::Isolate* isolate)
|
ObjectTemplateBuilder::ObjectTemplateBuilder(
|
||||||
: isolate_(isolate), template_(v8::ObjectTemplate::New()) {
|
v8::Isolate* isolate,
|
||||||
|
v8::Local<v8::ObjectTemplate> templ)
|
||||||
|
: isolate_(isolate), template_(templ) {
|
||||||
template_->SetInternalFieldCount(1);
|
template_->SetInternalFieldCount(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,9 @@ struct CallbackTraits<v8::Handle<v8::FunctionTemplate> > {
|
||||||
// v8::ObjectTemplate instances with various sorts of properties.
|
// v8::ObjectTemplate instances with various sorts of properties.
|
||||||
class ObjectTemplateBuilder {
|
class ObjectTemplateBuilder {
|
||||||
public:
|
public:
|
||||||
explicit ObjectTemplateBuilder(v8::Isolate* isolate);
|
explicit ObjectTemplateBuilder(
|
||||||
|
v8::Isolate* isolate,
|
||||||
|
v8::Local<v8::ObjectTemplate> templ = v8::ObjectTemplate::New());
|
||||||
~ObjectTemplateBuilder();
|
~ObjectTemplateBuilder();
|
||||||
|
|
||||||
// It's against Google C++ style to return a non-const ref, but we take some
|
// It's against Google C++ style to return a non-const ref, but we take some
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue