[Pkg-javascript-commits] [less.js] 11/285: remove unused optimization level

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:23:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.0.0
in repository less.js.

commit c844b022f9644ef6bbb452f6676d982aadb33f28
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sat Feb 15 14:49:25 2014 +0000

    remove unused optimization level
---
 benchmark/less-benchmark.js | 2 +-
 lib/less/browser.js         | 3 ---
 lib/less/env.js             | 1 -
 lib/less/lessc_helper.js    | 4 ----
 lib/less/parser.js          | 6 ------
 lib/less/rhino.js           | 4 ----
 6 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/benchmark/less-benchmark.js b/benchmark/less-benchmark.js
index ba789d5..3134728 100644
--- a/benchmark/less-benchmark.js
+++ b/benchmark/less-benchmark.js
@@ -15,7 +15,7 @@ fs.readFile(file, 'utf8', function (e, data) {
 
     start = new(Date);
 
-    new(less.Parser)({ optimization: 2 }).parse(data, function (err, tree) {
+    new(less.Parser)().parse(data, function (err, tree) {
         end = new Date();
 
         total = end - start;
diff --git a/lib/less/browser.js b/lib/less/browser.js
index ffcf82f..cbc6406 100644
--- a/lib/less/browser.js
+++ b/lib/less/browser.js
@@ -568,7 +568,6 @@ function loadStyleSheets(callback, reload, modifyVars) {
 
 function initRunningMode(){
     if (less.env === 'development') {
-        less.optimization = 0;
         less.watchTimer = setInterval(function () {
             if (less.watchMode) {
                 loadStyleSheets(function (e, root, _, sheet, env) {
@@ -580,8 +579,6 @@ function initRunningMode(){
                 });
             }
         }, less.poll);
-    } else {
-        less.optimization = 3;
     }
 }
 
diff --git a/lib/less/env.js b/lib/less/env.js
index 10c7302..41eabe5 100644
--- a/lib/less/env.js
+++ b/lib/less/env.js
@@ -2,7 +2,6 @@
 
     var parseCopyProperties = [
         'paths',            // option - unmodified - paths to search for imports on
-        'optimization',     // option - optimization level (for the chunker)
         'files',            // list of files that have been imported, used for import-once
         'contents',         // map - filename to contents of all the files
         'contentsIgnoredChars', // map - filename to lines at the begining of each file to ignore
diff --git a/lib/less/lessc_helper.js b/lib/less/lessc_helper.js
index 76355eb..ce758b7 100644
--- a/lib/less/lessc_helper.js
+++ b/lib/less/lessc_helper.js
@@ -61,10 +61,6 @@ var lessc_helper = {
         console.log("  --modify-var='VAR=VALUE' Modifies a variable already declared in the file.");
         console.log("");
         console.log("-------------------------- Deprecated ----------------");
-        console.log("  -O0, -O1, -O2            Set the parser's optimization level. The lower");
-        console.log("                           the number, the less nodes it will create in the");
-        console.log("                           tree. This could matter for debugging, or if you");
-        console.log("                           want to access the individual nodes in the tree.");
         console.log("  --line-numbers=TYPE      Outputs filename and line numbers.");
         console.log("                           TYPE can be either 'comments', which will output");
         console.log("                           the debug info within comments, 'mediaquery'");
diff --git a/lib/less/parser.js b/lib/less/parser.js
index 018a280..30635a1 100644
--- a/lib/less/parser.js
+++ b/lib/less/parser.js
@@ -335,12 +335,6 @@ less.Parser = function Parser(env) {
 
     this.env = env = env || {};
 
-    // The optimization level dictates the thoroughness of the parser,
-    // the lower the number, the less nodes it will create in the tree.
-    // This could matter for debugging, or if you want to access
-    // the individual nodes in the tree.
-    this.optimization = ('optimization' in this.env) ? this.env.optimization : 1;
-
     //
     // The Parser
     //
diff --git a/lib/less/rhino.js b/lib/less/rhino.js
index 0ff7aaf..f961011 100644
--- a/lib/less/rhino.js
+++ b/lib/less/rhino.js
@@ -150,7 +150,6 @@ function writeFile(filename, content) {
         compress: false,
         cleancss: false,
         max_line_len: -1,
-        optimization: 1,
         silent: false,
         verbose: false,
         lint: false,
@@ -269,9 +268,6 @@ function writeFile(filename, content) {
                             });
                 }
                 break;
-            case 'O0': options.optimization = 0; break;
-            case 'O1': options.optimization = 1; break;
-            case 'O2': options.optimization = 2; break;
             case 'line-numbers':
                 if (checkArgFunc(arg, match[2])) {
                     options.dumpLineNumbers = match[2];

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list