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
95b7ca63
Commit
95b7ca63
authored
Jan 02, 2014
by
Nick Schonning
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "more tweaks"
This reverts commit
e63b9d44
.
parent
42fade95
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
binding.cpp
binding.cpp
+21
-10
No files found.
binding.cpp
View file @
95b7ca63
...
@@ -82,28 +82,39 @@ void MakeCallback(uv_work_t* req) {
...
@@ -82,28 +82,39 @@ 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
);
Local
<
Value
>
val
,
err
;
sass_context
*
ctx
=
static_cast
<
sass_context
*>
(
ctx_w
->
ctx
);
const
unsigned
argc
=
1
;
sass_file_context
*
fctx
=
static_cast
<
sass_file_context
*>
(
ctx_w
->
fctx
);
int
error_status
=
ctx_w
->
ctx
?
ctx_w
->
ctx
->
error_status
:
ctx_w
->
fctx
->
error_status
;
if
(
error_status
==
0
)
{
if
(
(
ctx
&&
ctx
->
error_status
==
0
)
||
(
fctx
&&
fctx
->
error_status
==
0
)
)
{
// if no error, do callback(null, result)
// if no error, do callback(null, result)
val
=
ctx_w
->
ctx
?
Local
<
Value
>::
New
(
String
::
New
(
ctx_w
->
ctx
->
output_string
))
:
Local
<
Value
>::
New
(
String
::
New
(
ctx_w
->
fctx
->
output_string
));
const
unsigned
argc
=
1
;
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)
err
=
ctx_w
->
ctx
?
Local
<
Value
>::
New
(
String
::
New
(
ctx_w
->
ctx
->
error_message
))
:
Local
<
Value
>::
New
(
String
::
New
(
ctx_w
->
fctx
->
error_message
));
const
unsigned
argc
=
1
;
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
(
ctx_w
->
ctx
)
{
if
(
f
ctx
)
{
delete
ctx_w
->
ctx
->
source_string
;
delete
fctx
->
input_path
;
}
else
{
}
else
if
(
ctx
)
{
delete
ctx
_w
->
fctx
->
input_path
;
delete
ctx
->
source_string
;
}
}
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