Evan You пре 12 година
родитељ
комит
0474b1f9d9
4 измењених фајлова са 9 додато и 4 уклоњено
  1. 3 1
      src/instance/element.js
  2. 2 2
      src/parse/path.js
  3. 2 1
      src/parse/template.js
  4. 2 0
      src/util/env.js

+ 3 - 1
src/instance/element.js

@@ -18,7 +18,7 @@ exports._initElement = function (el) {
   // considered a "block instance" which manages not a single element,
   // but multiple elements. A block instance's `$el` is an Array of
   // the elements it manages.
-  if (el instanceof DocumentFragment) {
+  if (el instanceof window.DocumentFragment) {
     this._isBlock = true
     this.$el = _.toArray(el.childNodes)
   } else {
@@ -77,6 +77,8 @@ exports._initTemplate = function () {
  */
 
 exports._collectRawContent = function () {
+  var el = this.$el
+  var child
   if (el.hasChildNodes()) {
     this.rawContent = document.createElement('div')
     /* jshint boss: true */

+ 2 - 2
src/parse/path.js

@@ -1,8 +1,8 @@
 var _ = require('../util')
 var Cache = require('../cache')
 var pathCache = new Cache(1000)
-var identStart = '[\$_a-zA-Z]'
-var identPart = '[\$_a-zA-Z0-9]'
+var identStart = '[$_a-zA-Z]'
+var identPart = '[$_a-zA-Z0-9]'
 var IDENT_RE = new RegExp('^' + identStart + '+' + identPart + '*' + '$')
 
 /**

+ 2 - 1
src/parse/template.js

@@ -68,6 +68,7 @@ function stringToFragment (templateString) {
     }
 
     var child
+    /* jshint boss:true */
     while (child = node.firstChild) {
       if (node.nodeType === 1) {
         frag.appendChild(child)
@@ -116,7 +117,7 @@ exports.parse = function (template) {
   var node, frag
 
   // if the template is already a document fragment -- do nothing
-  if (template instanceof DocumentFragment) {
+  if (template instanceof window.DocumentFragment) {
     return template
   }
 

+ 2 - 0
src/util/env.js

@@ -1,3 +1,5 @@
+/* global chrome */
+
 /**
  * Are we in a browser or in Node?
  * Calling toString on window has inconsistent results in browsers