Skip to content

Commit

Permalink
Code: Renames callback <-> success_callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 committed Nov 18, 2014
1 parent 3a9c84b commit fa595ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/binding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void ExtractOptions(Local<Object> options, void* cptr, sass_context_wrapper* ctx
NanAssignPersistent(ctx_w->stats, options->Get(NanNew("stats"))->ToObject());

// async (callback) style
Local<Function> callback = Local<Function>::Cast(options->Get(NanNew("success")));
Local<Function> success_callback = Local<Function>::Cast(options->Get(NanNew("success")));
Local<Function> error_callback = Local<Function>::Cast(options->Get(NanNew("error")));
Local<Function> importer_callback = Local<Function>::Cast(options->Get(NanNew("importer")));

Expand All @@ -84,7 +84,7 @@ void ExtractOptions(Local<Object> options, void* cptr, sass_context_wrapper* ctx
ctx_w->dctx = (struct Sass_Data_Context*) cptr;
}
ctx_w->request.data = ctx_w;
ctx_w->callback = new NanCallback(callback);
ctx_w->success_callback = new NanCallback(success_callback);
ctx_w->error_callback = new NanCallback(error_callback);
ctx_w->importer_callback = new NanCallback(importer_callback);

Expand Down Expand Up @@ -157,7 +157,7 @@ void MakeCallback(uv_work_t* req) {
NanNew<String>(val),
NanNew(ctx_w->stats)->Get(NanNew("sourceMap"))
};
ctx_w->callback->Call(2, argv);
ctx_w->success_callback->Call(2, argv);
} else {
// if error, do callback(error)
const char* err = sass_context_get_error_json(ctx);
Expand Down
2 changes: 1 addition & 1 deletion src/sass_context_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C" {
}

NanDisposePersistent(ctx_w->stats);
delete ctx_w->callback;
delete ctx_w->success_callback;
delete ctx_w->error_callback;
delete ctx_w->importer_callback;

Expand Down
2 changes: 1 addition & 1 deletion src/sass_context_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct sass_context_wrapper {
Sass_File_Context* fctx;
Persistent<Object> stats;
uv_work_t request;
NanCallback* callback;
NanCallback* success_callback;
NanCallback* error_callback;
NanCallback* importer_callback;
};
Expand Down

0 comments on commit fa595ff

Please sign in to comment.