Commit 920225a9 by Adeel

Code: Interface changes for latest libsass.

parent 53b11171
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
......
......@@ -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();
......
......@@ -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' ],
}]
]
}
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment