本文整理汇总了C++中nan::EscapableHandleScope类的典型用法代码示例。如果您正苦于以下问题:C++ EscapableHandleScope类的具体用法?C++ EscapableHandleScope怎么用?C++ EscapableHandleScope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EscapableHandleScope类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: DILexicalBlock
v8::Local<v8::Value> DILexicalBlock::Create(llvm::DILexicalBlock* llvm_dilexicalblock) {
Nan::EscapableHandleScope scope;
Local<Object> new_instance = Nan::NewInstance(Nan::New(DILexicalBlock::constructor_func)).ToLocalChecked();
DILexicalBlock* new_dilexicalblock = new DILexicalBlock(llvm_dilexicalblock);
new_dilexicalblock->Wrap(new_instance);
return scope.Escape(new_instance);
}
开发者ID:toshok,项目名称:echojs,代码行数:7,代码来源:dibuilder.cpp
示例2: DebugLoc
v8::Local<v8::Value> DebugLoc::Create(llvm::DebugLoc llvm_debugloc) {
Nan::EscapableHandleScope scope;
Local<Object> new_instance = Nan::NewInstance(Nan::New(DebugLoc::constructor_func)).ToLocalChecked();
DebugLoc* new_debugloc = new DebugLoc(llvm_debugloc);
new_debugloc->Wrap(new_instance);
return scope.Escape(new_instance);
}
开发者ID:toshok,项目名称:echojs,代码行数:7,代码来源:dibuilder.cpp
示例3: DIFile
v8::Local<v8::Value> DIFile::Create(llvm::DIFile* llvm_difile) {
Nan::EscapableHandleScope scope;
Local<Object> new_instance = Nan::NewInstance(Nan::New(DIFile::constructor_func)).ToLocalChecked();
DIFile* new_difile = new DIFile(llvm_difile);
new_difile->Wrap(new_instance);
return scope.Escape(new_instance);
}
开发者ID:toshok,项目名称:echojs,代码行数:7,代码来源:dibuilder.cpp
示例4: DICompileUnit
v8::Local<v8::Value> DICompileUnit::Create(llvm::DICompileUnit* llvm_dicompileunit) {
Nan::EscapableHandleScope scope;
Local<Object> new_instance = Nan::NewInstance(Nan::New(DICompileUnit::constructor_func)).ToLocalChecked();
DICompileUnit* new_dicompileunit = new DICompileUnit(llvm_dicompileunit);
new_dicompileunit->Wrap(new_instance);
return scope.Escape(new_instance);
}
开发者ID:toshok,项目名称:echojs,代码行数:7,代码来源:dibuilder.cpp
示例5: DISubprogram
v8::Local<v8::Value> DISubprogram::Create(llvm::DISubprogram* llvm_disubprogram) {
Nan::EscapableHandleScope scope;
Local<Object> new_instance = Nan::NewInstance(Nan::New(DISubprogram::constructor_func)).ToLocalChecked();
DISubprogram* new_disubprogram = new DISubprogram(llvm_disubprogram);
new_disubprogram->Wrap(new_instance);
return scope.Escape(new_instance);
}
开发者ID:toshok,项目名称:echojs,代码行数:7,代码来源:dibuilder.cpp
示例6: MSOutputFormat
v8::Local<v8::Value> MSOutputFormat::NewInstance(outputFormatObj *of_ptr) {
Nan::EscapableHandleScope scope;
MSOutputFormat* of = new MSOutputFormat();
of->this_ = of_ptr;
v8::Local<v8::Value> ext = Nan::New<v8::External>(of);
return scope.Escape(Nan::New(constructor)->GetFunction()->NewInstance(1, &ext));
}
开发者ID:pagameba,项目名称:node-mapserver,代码行数:7,代码来源:ms_outputformat.cpp
示例7:
v8::Local<v8::Value> Grid::_clearSync(Nan::NAN_METHOD_ARGS_TYPE info)
{
Nan::EscapableHandleScope scope;
Grid* g = Nan::ObjectWrap::Unwrap<Grid>(info.Holder());
g->get()->clear();
return scope.Escape(Nan::Undefined());
}
开发者ID:BHare1985,项目名称:node-mapnik,代码行数:7,代码来源:mapnik_grid.cpp
示例8: MSLayers
v8::Local<v8::Value> MSLayers::NewInstance(mapObj *ptr) {
Nan::EscapableHandleScope scope;
MSLayers* obj = new MSLayers();
obj->this_ = ptr;
v8::Local<v8::Value> ext = Nan::New<v8::External>(obj);
return scope.Escape(Nan::New(constructor)->GetFunction()->NewInstance(1, &ext));
}
开发者ID:pagameba,项目名称:node-mapserver,代码行数:7,代码来源:ms_layers.cpp
示例9: getRequireCache
// Unfortunately native modules don't get a reference
// to require.cache as this happens in Module._compile()
// and native modules aren't compiled, they are loaded
// directly by NativeModule.require() (in Module._load())
// So we need to get it from Module._cache instead (by
// executing require('module')._cache)
static Local<Object> getRequireCache(Handle<Object> module) {
Nan::EscapableHandleScope scope;
Handle<Value> args[] = { Nan::New<String>("module").ToLocalChecked() };
Local<Value> m = module->Get(Nan::New<String>("require").ToLocalChecked())->ToObject()->CallAsFunction(Nan::GetCurrentContext()->Global(), 1, args);
Local<Object> cache = m->ToObject()->Get(Nan::New<String>("_cache").ToLocalChecked())->ToObject();
return scope.Escape(cache);
}
开发者ID:aaroncollins,项目名称:appmetrics,代码行数:13,代码来源:appmetrics.cpp
示例10: MemoryDatasource
v8::Local<v8::Value> MemoryDatasource::NewInstance(mapnik::datasource_ptr ds_ptr) {
Nan::EscapableHandleScope scope;
MemoryDatasource* d = new MemoryDatasource();
d->datasource_ = ds_ptr;
v8::Local<v8::Value> ext = Nan::New<v8::External>(d);
return scope.Escape( Nan::New(constructor)->GetFunction()->NewInstance(1, &ext));
}
开发者ID:BHare1985,项目名称:node-mapnik,代码行数:7,代码来源:mapnik_memory_datasource.cpp
示例11: wkbFlatten
Local<Value> Geometry::getConstructor(OGRwkbGeometryType type) {
Nan::EscapableHandleScope scope;
type = wkbFlatten(type);
switch (type) {
case wkbPoint:
return scope.Escape(Nan::New(Point::constructor)->GetFunction());
case wkbLineString:
return scope.Escape(Nan::New(LineString::constructor)->GetFunction());
case wkbLinearRing:
return scope.Escape(Nan::New(LinearRing::constructor)->GetFunction());
case wkbPolygon:
return scope.Escape(Nan::New(Polygon::constructor)->GetFunction());
case wkbGeometryCollection:
return scope.Escape(Nan::New(GeometryCollection::constructor)->GetFunction());
case wkbMultiPoint:
return scope.Escape(Nan::New(MultiPoint::constructor)->GetFunction());
case wkbMultiLineString:
return scope.Escape(Nan::New(MultiLineString::constructor)->GetFunction());
case wkbMultiPolygon:
return scope.Escape(Nan::New(MultiPolygon::constructor)->GetFunction());
default:
return scope.Escape(Nan::Null());
}
}
开发者ID:tomhughes,项目名称:node-gdal,代码行数:25,代码来源:gdal_geometry.cpp
示例12: Color
v8::Local<v8::Value> Color::NewInstance(mapnik::color const& color) {
Nan::EscapableHandleScope scope;
Color* c = new Color();
c->this_ = std::make_shared<mapnik::color>(color);
v8::Local<v8::Value> ext = Nan::New<v8::External>(c);
return scope.Escape(Nan::New(constructor)->GetFunction()->NewInstance(1, &ext));
}
开发者ID:cuulee,项目名称:node-mapnik,代码行数:7,代码来源:mapnik_color.cpp
示例13: Feature
v8::Local<v8::Value> Feature::NewInstance(mapnik::feature_ptr f_ptr)
{
Nan::EscapableHandleScope scope;
Feature* f = new Feature(f_ptr);
v8::Local<v8::Value> ext = Nan::New<v8::External>(f);
return scope.Escape(Nan::New(constructor)->GetFunction()->NewInstance(1, &ext));
}
开发者ID:bermi,项目名称:node-mapnik,代码行数:7,代码来源:mapnik_feature.cpp
示例14: operator
v8::Local<v8::Object> operator()(const point<T>& point) {
Nan::EscapableHandleScope scope;
v8::Local<v8::Array> result = Nan::New<v8::Array>(2);
Nan::Set(result, 0, Nan::New(point.x));
Nan::Set(result, 1, Nan::New(point.y));
return scope.Escape(result);
}
开发者ID:CyberLight,项目名称:mapbox-gl-native,代码行数:7,代码来源:node_feature.cpp
示例15: MultiPolygon
Local<Value> MultiPolygon::New(OGRMultiPolygon *geom, bool owned)
{
Nan::EscapableHandleScope scope;
if (!geom) {
return scope.Escape(Nan::Null());
}
//make a copy of geometry owned by a feature
// + no need to track when a feature is destroyed
// + no need to throw errors when a method trys to modify an owned read-only geometry
// - is slower
if (!owned) {
geom = static_cast<OGRMultiPolygon*>(geom->clone());
};
MultiPolygon *wrapped = new MultiPolygon(geom);
wrapped->owned_ = true;
UPDATE_AMOUNT_OF_GEOMETRY_MEMORY(wrapped);
Local<Value> ext = Nan::New<External>(wrapped);
Local<Object> obj = Nan::New(MultiPolygon::constructor)->GetFunction()->NewInstance(1, &ext);
return scope.Escape(obj);
}
开发者ID:Wedjaa,项目名称:node-gdal,代码行数:27,代码来源:gdal_multipolygon.cpp
示例16: createBuffer
Handle<Object> createBuffer(char *data, int length) {
Nan::EscapableHandleScope scope;
Local<Object> buffer = Nan::CopyBuffer(data, length).ToLocalChecked();
return scope.Escape(buffer);
}
开发者ID:dturing,项目名称:node-gstreamer-superficial,代码行数:7,代码来源:GLibHelpers.cpp
示例17: Featureset
v8::Local<v8::Value> Featureset::NewInstance(mapnik::featureset_ptr fs_ptr)
{
Nan::EscapableHandleScope scope;
Featureset* fs = new Featureset();
fs->this_ = fs_ptr;
v8::Local<v8::Value> ext = Nan::New<v8::External>(fs);
return scope.Escape(Nan::New(constructor)->GetFunction()->NewInstance(1, &ext));
}
开发者ID:bermi,项目名称:node-mapnik,代码行数:8,代码来源:mapnik_featureset.cpp
示例18:
Local<Object> ODBC::GetSQLError (SQLSMALLINT handleType, SQLHANDLE handle) {
Nan::EscapableHandleScope scope;
return scope.Escape(GetSQLError(
handleType,
handle,
(char *) "[node-odbc] SQL_ERROR"));
}
开发者ID:jstopchick,项目名称:node-odbc,代码行数:8,代码来源:odbc.cpp
示例19: runtime_error
v8::Local<v8::Function> Convert::getCallbackFunction(v8::Local<v8::Value> js)
{
Nan::EscapableHandleScope scope;
if (!js->IsFunction())
{
throw std::runtime_error("function");
}
return scope.Escape(js.As<v8::Function>());
}
开发者ID:NordicSemiconductor,项目名称:pc-nrfjprog-js,代码行数:9,代码来源:conversion.cpp
示例20: next
Local<Value> next() {
Nan::EscapableHandleScope scope;
if (nextIt == items.end()) return scope.Escape(Nan::Undefined());
Local<Array> obj = Nan::New<Array>();
obj->Set(Nan::New(0), Nan::New(nextIt->first).ToLocalChecked());
obj->Set(Nan::New(1), Nan::New(nextIt->second).ToLocalChecked());
nextIt++;
return scope.Escape(obj);
}
开发者ID:vseryakov,项目名称:bkjs-cache,代码行数:9,代码来源:binding.cpp
注:本文中的nan::EscapableHandleScope类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论