Fixup 41caf2d
Lexical binding...
Fixes https://github.com/behdad/fonttools/issues/40
diff --git a/Lib/fontTools/ttLib/tables/otBase.py b/Lib/fontTools/ttLib/tables/otBase.py
index 0ee5141..e6fd0ab 100644
--- a/Lib/fontTools/ttLib/tables/otBase.py
+++ b/Lib/fontTools/ttLib/tables/otBase.py
@@ -608,12 +608,14 @@
name = conv.name
writer.writeCountReference(table, name)
counts.append(name)
- def storeValue(value):
- if table[name] is None:
- table[name] = value
- else:
- assert table[name] == value, (table[name], value)
- countVars[name] = storeValue
+ def storeValueFactory(table, name):
+ def storeValue(value):
+ if table[name] is None:
+ table[name] = value
+ else:
+ assert table[name] == value, (table[name], value)
+ return storeValue
+ countVars[name] = storeValueFactory(table, name)
else:
conv.write(writer, font, countVars, value)