Skip to content

Commit

Permalink
Hotfix for new API and error not being re-thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Nov 19, 2014
1 parent dfdeac6 commit 8957ad8
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions sass_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,25 +394,27 @@ extern "C" {
static int sass_compile_context (Sass_Context* c_ctx, Context::Data cpp_opt)
{

Context* cpp_ctx = 0;
// first prepare the c++ context
Context* cpp_ctx = sass_prepare_context(c_ctx, cpp_opt);

try {
// parse given context and return root block
Block* root = cpp_ctx ? sass_parse_block(c_ctx, cpp_ctx) : 0;

if (cpp_ctx && root) {

// first prepare the c++ context
cpp_ctx = sass_prepare_context(c_ctx, cpp_opt);
try {

// parse given context and return root block
Block* root = sass_parse_block(c_ctx, cpp_ctx);
// now compile the parsed root block
c_ctx->output_string = cpp_ctx->compile_block(root);

// now compile the parsed root block
c_ctx->output_string = cpp_ctx->compile_block(root);
// generate source map json and store on context
c_ctx->source_map_string = cpp_ctx->generate_source_map();

// generate source map json and store on context
c_ctx->source_map_string = cpp_ctx->generate_source_map();
}
// pass errors to generic error handler
catch (...) { handle_errors(c_ctx); }

}
// pass errors to generic error handler
catch (...) { handle_errors(c_ctx); }

delete cpp_ctx;

Expand Down

2 comments on commit 8957ad8

@am11
Copy link
Contributor

@am11 am11 commented on 8957ad8 Nov 19, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgreter, till the previous commit: dfdeac6, node-sass passes all the test with my current state of master branch: am11/node-sass@187cfde.

As soon as I checkout this commit (or the latest libsass master: 0f275a1), rebuild and rerun the tests; it fails file-watch related test: cli node-sass in.scss should render all watched files.

@am11
Copy link
Contributor

@am11 am11 commented on 8957ad8 Nov 21, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgreter, is there any more info I can provide to figure out the issue with watcher tests?

Please sign in to comment.