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
920225a9
Commit
920225a9
authored
Oct 05, 2014
by
Adeel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code: Interface changes for latest libsass.
parent
53b11171
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
16 deletions
+35
-16
.travis.yml
.travis.yml
+10
-0
binding.cpp
binding.cpp
+8
-9
binding.gyp
binding.gyp
+12
-2
sass.js
sass.js
+5
-5
No files found.
.travis.yml
View file @
920225a9
language
:
node_js
compiler
:
-
gcc
node_js
:
-
"
0.10"
-
"
0.11"
before_install
:
-
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test;
-
sudo apt-get update;
-
sudo apt-get install gcc-4.8 g++-4.8;
-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20;
-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20;
-
sudo g++ --version;
-
sudo apt-get update -qq;
-
git submodule update --init --recursive
after_success
:
-
npm run-script coverage
...
...
binding.cpp
View file @
920225a9
...
...
@@ -31,7 +31,7 @@ char* CreateString(Local<Value> value) {
}
void
ExtractOptions
(
Local
<
Value
>
optionsValue
,
void
*
cptr
,
sass_context_wrapper
*
ctx_w
,
bool
isFile
)
{
int
source_comments
;
bool
source_comments
;
Local
<
Object
>
options
=
optionsValue
->
ToObject
();
if
(
ctx_w
)
{
...
...
@@ -56,12 +56,10 @@ void ExtractOptions(Local<Value> optionsValue, void* cptr, sass_context_wrapper*
ctx
->
output_path
=
CreateString
(
options
->
Get
(
NanNew
(
"outFile"
)));
ctx
->
options
.
image_path
=
CreateString
(
options
->
Get
(
NanNew
(
"imagePath"
)));
ctx
->
options
.
output_style
=
options
->
Get
(
NanNew
(
"style"
))
->
Int32Value
();
ctx
->
options
.
source_comments
=
source_comments
=
options
->
Get
(
NanNew
(
"comments"
))
->
Int32Value
();
ctx
->
omit_source_map_url
=
options
->
Get
(
NanNew
(
"omitSourceMapUrl"
))
->
BooleanValue
();
ctx
->
options
.
source_comments
=
source_comments
=
options
->
Get
(
NanNew
(
"comments"
))
->
BooleanValue
();
ctx
->
options
.
omit_source_map_url
=
options
->
Get
(
NanNew
(
"omitSourceMapUrl"
))
->
BooleanValue
();
ctx
->
options
.
source_map_file
=
CreateString
(
options
->
Get
(
NanNew
(
"sourceMap"
)));
ctx
->
options
.
include_paths
=
CreateString
(
options
->
Get
(
NanNew
(
"paths"
)));
if
(
source_comments
==
SASS_SOURCE_COMMENTS_MAP
)
{
ctx
->
source_map_file
=
CreateString
(
options
->
Get
(
NanNew
(
"sourceMap"
)));
}
ctx
->
options
.
precision
=
options
->
Get
(
NanNew
(
"precision"
))
->
Int32Value
();
}
else
{
sass_context
*
ctx
=
(
sass_context
*
)
cptr
;
...
...
@@ -69,8 +67,9 @@ void ExtractOptions(Local<Value> optionsValue, void* cptr, sass_context_wrapper*
ctx
->
output_path
=
CreateString
(
options
->
Get
(
NanNew
(
"outFile"
)));
ctx
->
options
.
image_path
=
CreateString
(
options
->
Get
(
NanNew
(
"imagePath"
)));
ctx
->
options
.
output_style
=
options
->
Get
(
NanNew
(
"style"
))
->
Int32Value
();
ctx
->
options
.
source_comments
=
source_comments
=
options
->
Get
(
NanNew
(
"comments"
))
->
Int32Value
();
ctx
->
omit_source_map_url
=
options
->
Get
(
NanNew
(
"omitSourceMapUrl"
))
->
BooleanValue
();
ctx
->
options
.
source_comments
=
source_comments
=
options
->
Get
(
NanNew
(
"comments"
))
->
BooleanValue
();
ctx
->
options
.
omit_source_map_url
=
options
->
Get
(
NanNew
(
"omitSourceMapUrl"
))
->
BooleanValue
();
ctx
->
options
.
source_map_file
=
CreateString
(
options
->
Get
(
NanNew
(
"sourceMap"
)));
ctx
->
options
.
include_paths
=
CreateString
(
options
->
Get
(
NanNew
(
"paths"
)));
ctx
->
options
.
precision
=
options
->
Get
(
NanNew
(
"precision"
))
->
Int32Value
();
}
...
...
@@ -96,7 +95,7 @@ void FillStatsObj(Handle<Object> stats, sass_file_context* ctx) {
if
(
ctx
->
error_status
)
{
return
;
}
if
(
ctx
->
options
.
source_comments
==
SASS_SOURCE_COMMENTS_MAP
)
{
if
(
ctx
->
source_map_string
)
{
source_map
=
NanNew
<
String
>
(
ctx
->
source_map_string
);
}
else
{
source_map
=
NanNull
();
...
...
binding.gyp
View file @
920225a9
...
...
@@ -19,19 +19,22 @@
'libsass/file.cpp',
'libsass/functions.cpp',
'libsass/inspect.cpp',
'libsass/node.cpp',
'libsass/output_compressed.cpp',
'libsass/output_nested.cpp',
'libsass/parser.cpp',
'libsass/prelexer.cpp',
'libsass/remove_placeholders.cpp',
'libsass/sass.cpp',
'libsass/sass2scss.cpp',
'libsass/sass_interface.cpp',
'libsass/sass_util.cpp',
'libsass/source_map.cpp',
'libsass/to_c.cpp',
'libsass/to_string.cpp',
'libsass/units.cpp',
'libsass/utf8_string.cpp',
'libsass/util.cpp',
'libsass/sass2scss/sass2scss.cpp'
'libsass/util.cpp'
],
'include_dirs': [
'<!(node -e "require(\'nan\')")'
...
...
@@ -42,6 +45,8 @@
'conditions': [
['OS=="mac"', {
'xcode_settings': {
'OTHER_CPLUSPLUSFLAGS' : [ '-std=c++11', '-stdlib=libc++' ],
'OTHER_LDFLAGS': [ '-stdlib=libc++' ],
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'GCC_ENABLE_CPP_RTTI': 'YES',
'MACOSX_DEPLOYMENT_TARGET': '10.7'
...
...
@@ -62,6 +67,11 @@
# decorated name length exceeded
4503
]
}],
[ 'OS!="win"', {
'cflags+': [ '-std=c++11' ],
'cflags_c+': [ '-std=c++11' ],
'cflags_cc+': [ '-std=c++11' ],
}]
]
}
...
...
sass.js
View file @
920225a9
...
...
@@ -32,10 +32,10 @@ var SASS_OUTPUT_STYLE = {
};
var
SASS_SOURCE_COMMENTS
=
{
none
:
0
,
normal
:
1
,
'default'
:
1
,
map
:
2
none
:
false
,
normal
:
true
,
default
:
false
,
map
:
true
};
var
prepareOptions
=
function
(
options
)
{
...
...
@@ -81,7 +81,7 @@ var prepareOptions = function (options) {
paths
:
(
options
.
include_paths
||
options
.
includePaths
||
[]).
join
(
path
.
delimiter
),
imagePath
:
options
.
image_path
||
options
.
imagePath
||
''
,
style
:
SASS_OUTPUT_STYLE
[
options
.
output_style
||
options
.
outputStyle
]
||
0
,
comments
:
SASS_SOURCE_COMMENTS
[
sourceComments
]
||
0
,
comments
:
SASS_SOURCE_COMMENTS
[
sourceComments
]
||
false
,
omitSourceMapUrl
:
options
.
omitSourceMapUrl
,
stats
:
stats
,
sourceMap
:
sourceMap
,
...
...
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