From fcda005c56e966c94fbc415c29bada05419103b3 Mon Sep 17 00:00:00 2001
From: "Davide P. Cervone" <dpvc@union.edu>
Date: Tue, 14 Jun 2016 14:22:51 -0400
Subject: [PATCH 1/2] Don't copy environment into array environments.  Resolves
 issue #1468.

---
 unpacked/jax/input/TeX/jax.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js
index eeec47541..b16dafc8e 100644
--- a/unpacked/jax/input/TeX/jax.js
+++ b/unpacked/jax/input/TeX/jax.js
@@ -53,8 +53,10 @@
         else if (top) {
           this.data.push(item);
           if (item.env) {
-            for (var id in this.env)
-              {if (this.env.hasOwnProperty(id)) {item.env[id] = this.env[id]}}
+            if (item.copyEnv !== false) {
+              for (var id in this.env)
+                {if (this.env.hasOwnProperty(id)) {item.env[id] = this.env[id]}}
+            }
             this.env = item.env;
           } else {item.env = this.env}
         }
@@ -258,7 +260,8 @@
   STACKITEM.array = STACKITEM.Subclass({
     type: "array", isOpen: true, arraydef: {},
     Init: function () {
-      this.table = []; this.row = []; this.env = {}; this.frame = []; this.hfill = [];
+      this.table = []; this.row = []; this.frame = []; this.hfill = [];
+      this.copyEnv = false;
       this.SUPER(arguments).Init.apply(this,arguments);
     },
     checkItem: function (item) {
-- 
GitLab


From dbc70acd58761ca1dc32944135789fc9199b17db Mon Sep 17 00:00:00 2001
From: "Davide P. Cervone" <dpvc@union.edu>
Date: Tue, 14 Jun 2016 14:59:49 -0400
Subject: [PATCH 2/2] Make copyEnv a shared constant.

---
 unpacked/jax/input/TeX/jax.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js
index b16dafc8e..36e53592c 100644
--- a/unpacked/jax/input/TeX/jax.js
+++ b/unpacked/jax/input/TeX/jax.js
@@ -258,10 +258,9 @@
   });
   
   STACKITEM.array = STACKITEM.Subclass({
-    type: "array", isOpen: true, arraydef: {},
+    type: "array", isOpen: true, copyEnv: false, arraydef: {},
     Init: function () {
       this.table = []; this.row = []; this.frame = []; this.hfill = [];
-      this.copyEnv = false;
       this.SUPER(arguments).Init.apply(this,arguments);
     },
     checkItem: function (item) {
-- 
GitLab