[Pkg-javascript-commits] [node-acorn-jsx] 317/484: Make setOptions non-destructive for original object.

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:49 UTC 2017


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

rouca pushed a commit to branch master
in repository node-acorn-jsx.

commit b7367a2a8c12a3122adb42cac98960140247772e
Author: Ingvar Stepanyan <me at rreverser.com>
Date:   Sun Oct 26 20:21:39 2014 +0200

    Make setOptions non-destructive for original object.
---
 acorn.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/acorn.js b/acorn.js
index 14648d3..e6658d8 100644
--- a/acorn.js
+++ b/acorn.js
@@ -135,9 +135,9 @@
   };
 
   function setOptions(opts) {
-    options = opts || {};
-    for (var opt in defaultOptions) if (!has(options, opt))
-      options[opt] = defaultOptions[opt];
+    options = {};
+    for (var opt in defaultOptions)
+      options[opt] = has(opts, opt) ? opts[opt] : defaultOptions[opt];
     sourceFile = options.sourceFile || null;
     if (isArray(options.onToken)) {
       var tokens = options.onToken;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-acorn-jsx.git



More information about the Pkg-javascript-commits mailing list