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
e63b9d44
Commit
e63b9d44
authored
Dec 29, 2013
by
Dean Mao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tweaks
parent
b577f579
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
21 deletions
+10
-21
binding.cpp
binding.cpp
+10
-21
No files found.
binding.cpp
View file @
e63b9d44
...
@@ -82,39 +82,28 @@ void MakeCallback(uv_work_t* req) {
...
@@ -82,39 +82,28 @@ void MakeCallback(uv_work_t* req) {
HandleScope
scope
;
HandleScope
scope
;
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
);
sass_context
*
ctx
=
static_cast
<
sass_context
*>
(
ctx_w
->
ctx
);
Local
<
Value
>
val
,
err
;
sass_file_context
*
fctx
=
static_cast
<
sass_file_context
*>
(
ctx_w
->
fctx
);
const
unsigned
argc
=
1
;
int
error_status
=
ctx_w
->
ctx
?
ctx_w
->
ctx
->
error_status
:
ctx_w
->
fctx
->
error_status
;
if
(
(
ctx
&&
ctx
->
error_status
==
0
)
||
(
fctx
&&
fctx
->
error_status
==
0
)
)
{
if
(
error_status
==
0
)
{
// if no error, do callback(null, result)
// if no error, do callback(null, result)
const
unsigned
argc
=
1
;
val
=
ctx_w
->
ctx
?
Local
<
Value
>::
New
(
String
::
New
(
ctx_w
->
ctx
->
output_string
))
:
Local
<
Value
>::
New
(
String
::
New
(
ctx_w
->
fctx
->
output_string
));
Local
<
Value
>
val
;
if
(
ctx
)
{
val
=
Local
<
Value
>::
New
(
String
::
New
(
ctx
->
output_string
));
}
else
{
val
=
Local
<
Value
>::
New
(
String
::
New
(
fctx
->
output_string
));
}
Local
<
Value
>
argv
[
argc
]
=
{
val
};
Local
<
Value
>
argv
[
argc
]
=
{
val
};
ctx_w
->
callback
->
Call
(
Context
::
GetCurrent
()
->
Global
(),
argc
,
argv
);
ctx_w
->
callback
->
Call
(
Context
::
GetCurrent
()
->
Global
(),
argc
,
argv
);
}
else
{
}
else
{
// if error, do callback(error)
// if error, do callback(error)
const
unsigned
argc
=
1
;
err
=
ctx_w
->
ctx
?
Local
<
Value
>::
New
(
String
::
New
(
ctx_w
->
ctx
->
error_message
))
:
Local
<
Value
>::
New
(
String
::
New
(
ctx_w
->
fctx
->
error_message
));
Local
<
Value
>
err
;
if
(
ctx
)
{
err
=
Local
<
Value
>::
New
(
String
::
New
(
ctx
->
error_message
));
}
else
{
err
=
Local
<
Value
>::
New
(
String
::
New
(
fctx
->
error_message
));
}
Local
<
Value
>
argv
[
argc
]
=
{
err
};
Local
<
Value
>
argv
[
argc
]
=
{
err
};
ctx_w
->
errorCallback
->
Call
(
Context
::
GetCurrent
()
->
Global
(),
argc
,
argv
);
ctx_w
->
errorCallback
->
Call
(
Context
::
GetCurrent
()
->
Global
(),
argc
,
argv
);
}
}
if
(
try_catch
.
HasCaught
())
{
if
(
try_catch
.
HasCaught
())
{
node
::
FatalException
(
try_catch
);
node
::
FatalException
(
try_catch
);
}
}
if
(
f
ctx
)
{
if
(
ctx_w
->
ctx
)
{
delete
fctx
->
input_path
;
delete
ctx_w
->
ctx
->
source_string
;
}
else
if
(
ctx
)
{
}
else
{
delete
ctx
->
source_string
;
delete
ctx
_w
->
fctx
->
input_path
;
}
}
sass_free_context_wrapper
(
ctx_w
);
sass_free_context_wrapper
(
ctx_w
);
}
}
...
...
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