add node v0.12 and io.js compatibility

This commit is contained in:
Mike Morris
2015-02-19 16:19:31 -05:00
parent 1455822111
commit c0fe624ecd
8 changed files with 63 additions and 33 deletions

View File

@@ -11,7 +11,6 @@
#include "node_request.hpp"
#include "compress_png.hpp"
void RegisterModule(v8::Handle<v8::Object> exports) {
NanScope();
@@ -22,7 +21,7 @@ void RegisterModule(v8::Handle<v8::Object> exports) {
// Exports Resource constants.
auto ConstantProperty = static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete);
auto resource = v8::Object::New();
auto resource = NanNew<v8::Object>();
resource->ForceSet(NanNew("Unknown"), NanNew(mbgl::Resource::Unknown), ConstantProperty);
resource->ForceSet(NanNew("Tile"), NanNew(mbgl::Resource::Tile), ConstantProperty);
resource->ForceSet(NanNew("Glyphs"), NanNew(mbgl::Resource::Glyphs), ConstantProperty);