Commit d9058348 by Johannes Ewald

Normalized option handling

parent 0d49a12a
...@@ -68,14 +68,12 @@ var deprecatedRender = function(css, callback, options) { ...@@ -68,14 +68,12 @@ var deprecatedRender = function(css, callback, options) {
options.success = function(css) { options.success = function(css) {
callback(null, css); callback(null, css);
}; };
options.data = css; return binding.render(css, options.imagePath, options.success, options.error, options.paths, options.style, options.comments);
return binding.render(options);
}; };
var deprecatedRenderSync = function(css, options) { var deprecatedRenderSync = function(css, options) {
options = prepareOptions(options); options = prepareOptions(options);
options.data = css; return binding.renderSync(css, options.imagePath, options.paths, options.style, options.comments);
return binding.renderSync(options);
}; };
exports.render = function(options) { exports.render = function(options) {
...@@ -86,11 +84,11 @@ exports.render = function(options) { ...@@ -86,11 +84,11 @@ exports.render = function(options) {
options = prepareOptions(options); options = prepareOptions(options);
if (options.file) { if (options.file) {
return binding.renderFile(options); return binding.renderFile(options.file, options.imagePath, options.success, options.error, options.paths, options.style, options.comments, options.sourceMap);
} }
//Assume data is present if file is not. binding/libsass will tell the user otherwise! //Assume data is present if file is not. binding/libsass will tell the user otherwise!
return binding.render(options); return binding.render(options.data, options.imagePath, options.success, options.error, options.paths, options.style);
}; };
exports.renderSync = function(options) { exports.renderSync = function(options) {
...@@ -101,11 +99,11 @@ exports.renderSync = function(options) { ...@@ -101,11 +99,11 @@ exports.renderSync = function(options) {
options = prepareOptions(options); options = prepareOptions(options);
if (options.file) { if (options.file) {
return binding.renderFileSync(options); return binding.renderFileSync(options.file, options.imagePath, options.paths, options.style, options.comments);
} }
//Assume data is present if file is not. binding/libsass will tell the user otherwise! //Assume data is present if file is not. binding/libsass will tell the user otherwise!
return binding.renderSync(options); return binding.renderSync(options.data, options.imagePath, options.paths, options.style);
}; };
/** /**
......
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