Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
楚学文
node-sass
Commits
7eeba5e4
Commit
7eeba5e4
authored
Jan 02, 2014
by
Dean Mao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass error_status as a result to error callback
parent
a5007aea
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
binding.cpp
binding.cpp
+3
-3
No files found.
binding.cpp
View file @
7eeba5e4
...
@@ -84,11 +84,11 @@ void MakeCallback(uv_work_t* req) {
...
@@ -84,11 +84,11 @@ void MakeCallback(uv_work_t* req) {
TryCatch
try_catch
;
TryCatch
try_catch
;
sass_context_wrapper
*
ctx_w
=
static_cast
<
sass_context_wrapper
*>
(
req
->
data
);
sass_context_wrapper
*
ctx_w
=
static_cast
<
sass_context_wrapper
*>
(
req
->
data
);
Handle
<
Value
>
val
,
err
;
Handle
<
Value
>
val
,
err
;
const
unsigned
argc
=
2
;
int
error_status
=
ctx_w
->
ctx
?
ctx_w
->
ctx
->
error_status
:
ctx_w
->
fctx
->
error_status
;
int
error_status
=
ctx_w
->
ctx
?
ctx_w
->
ctx
->
error_status
:
ctx_w
->
fctx
->
error_status
;
if
(
error_status
==
0
)
{
if
(
error_status
==
0
)
{
// if no error, do callback(null, result)
// if no error, do callback(null, result)
const
unsigned
argc
=
2
;
Handle
<
Value
>
source_map
;
Handle
<
Value
>
source_map
;
if
(
ctx_w
->
fctx
&&
ctx_w
->
fctx
->
options
.
source_comments
==
SASS_SOURCE_COMMENTS_MAP
)
{
if
(
ctx_w
->
fctx
&&
ctx_w
->
fctx
->
options
.
source_comments
==
SASS_SOURCE_COMMENTS_MAP
)
{
source_map
=
String
::
New
(
ctx_w
->
fctx
->
source_map_string
);
source_map
=
String
::
New
(
ctx_w
->
fctx
->
source_map_string
);
...
@@ -104,10 +104,10 @@ void MakeCallback(uv_work_t* req) {
...
@@ -104,10 +104,10 @@ void MakeCallback(uv_work_t* req) {
ctx_w
->
callback
->
Call
(
argc
,
argv
);
ctx_w
->
callback
->
Call
(
argc
,
argv
);
}
else
{
}
else
{
// if error, do callback(error)
// if error, do callback(error)
const
unsigned
argc
=
1
;
err
=
ctx_w
->
ctx
?
NanNewLocal
(
String
::
New
(
ctx_w
->
ctx
->
error_message
))
:
NanNewLocal
(
String
::
New
(
ctx_w
->
fctx
->
error_message
));
err
=
ctx_w
->
ctx
?
NanNewLocal
(
String
::
New
(
ctx_w
->
ctx
->
error_message
))
:
NanNewLocal
(
String
::
New
(
ctx_w
->
fctx
->
error_message
));
Local
<
Value
>
argv
[
argc
]
=
{
Local
<
Value
>
argv
[
argc
]
=
{
NanNewLocal
(
err
)
NanNewLocal
(
err
),
NanNewLocal
(
Integer
::
New
(
error_status
))
};
};
ctx_w
->
errorCallback
->
Call
(
argc
,
argv
);
ctx_w
->
errorCallback
->
Call
(
argc
,
argv
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment