Commit a0e3a55f by Adeel

Code: Removes unnecessary delete statements.

* Pass along the original property names to
  binding so we don't have to disown the
  existing ones and add the new ones.
* Although it is a delicate matter:
  //perfectionkills.com/understanding-delete/
  avoiding delete where you can is better for
  JS optimizers IMO.
  (hint: it de-optimizes the whole object to
   change its internal "shape", which means
   delete single property from object literal
   comes with a perf. trade-off)

PR URL: #727.
parent a0691b1b
......@@ -130,11 +130,11 @@ function getSourceMap(options) {
function getOptions(options, cb) {
options = options || {};
options.comments = options.sourceComments || false;
options.sourceComments = options.sourceComments || false;
options.data = options.data || null;
options.file = options.file || null;
options.outFile = getOutFile(options);
options.paths = (options.includePaths || []).join(path.delimiter);
options.includePaths = (options.includePaths || []).join(path.delimiter);
options.precision = parseInt(options.precision) || 5;
options.sourceMap = getSourceMap(options);
options.style = getStyle(options) || 0;
......@@ -165,11 +165,6 @@ function getOptions(options, cb) {
}
};
delete options.include_paths;
delete options.includePaths;
delete options.source_comments;
delete options.sourceComments;
options.result = {
stats: getStats(options)
};
......
......@@ -153,12 +153,12 @@ void extract_options(Local<Object> options, void* cptr, sass_context_wrapper* ct
sass_option_set_output_path(sass_options, create_string(options->Get(NanNew("outFile"))));
sass_option_set_output_style(sass_options, (Sass_Output_Style)options->Get(NanNew("style"))->Int32Value());
sass_option_set_is_indented_syntax_src(sass_options, options->Get(NanNew("indentedSyntax"))->BooleanValue());
sass_option_set_source_comments(sass_options, options->Get(NanNew("comments"))->BooleanValue());
sass_option_set_source_comments(sass_options, options->Get(NanNew("sourceComments"))->BooleanValue());
sass_option_set_omit_source_map_url(sass_options, options->Get(NanNew("omitSourceMapUrl"))->BooleanValue());
sass_option_set_source_map_embed(sass_options, options->Get(NanNew("sourceMapEmbed"))->BooleanValue());
sass_option_set_source_map_contents(sass_options, options->Get(NanNew("sourceMapContents"))->BooleanValue());
sass_option_set_source_map_file(sass_options, create_string(options->Get(NanNew("sourceMap"))));
sass_option_set_include_path(sass_options, create_string(options->Get(NanNew("paths"))));
sass_option_set_include_path(sass_options, create_string(options->Get(NanNew("includePaths"))));
sass_option_set_precision(sass_options, options->Get(NanNew("precision"))->Int32Value());
}
......
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