Browse Source

fix bug from last commit

Evan You 12 years ago
parent
commit
345724a1e6
2 changed files with 4 additions and 5 deletions
  1. 4 3
      src/compiler.js
  2. 0 2
      test/unit/specs/viewmodel.js

+ 4 - 3
src/compiler.js

@@ -71,9 +71,10 @@ function Compiler (vm, options) {
     }
 
     // create bindings for keys set on the vm by the user
-    for (var key in vm) {
-        key = key.charAt(0)
-        if (key !== '$' && key !== '_') {
+    var key, keyPrefix
+    for (key in vm) {
+        keyPrefix = key.charAt(0)
+        if (keyPrefix !== '$' && keyPrefix !== '_') {
             compiler.createBinding(key)
         }
     }

+ 0 - 2
test/unit/specs/viewmodel.js

@@ -6,8 +6,6 @@
  *  - .$unwatch()
  */
 
- var seed = require('seed')
-
 describe('UNIT: ViewModel', function () {
 
     mock('vm-test', '{{a.b.c}}')