Permalink
Browse files

npmanaize bugfixes

  • Loading branch information...
1 parent ede96d0 commit 94d7ae74d8cebf36143c23d913bbd61d248371b1 @KoryNunn KoryNunn committed Apr 30, 2013
Showing with 927 additions and 938 deletions.
  1. +2 −1 .gitignore
  2. +45 −56 gedi.js
  3. +1 −1 package.json
  4. +1 −880 test.html
  5. +878 −0 test.js
View
@@ -1 +1,2 @@
-node_modules
+node_modules
+*.browser.js
View
101 gedi.js
@@ -13,9 +13,12 @@
define(factory);
} else {
root.Gedi = factory();
- }
+ }
+}(this, function(){
"use strict";
+ var Gel = require('gel-js');
+
//Create gedi
var gediConstructor = newGedi;
@@ -126,7 +129,7 @@
else if(substring.charAt(index) === ']'){
var original = substring.slice(0, index+1);
- return new Lang.Token(
+ return new Gel.Token(
this,
original,
original.length
@@ -143,52 +146,50 @@
//
//***********************************************
- if (window.Gel) {
- gel = new window.Gel();
+ gel = new Gel();
+
+ gel.tokenConverters.push({
+ name: 'gediPathToken',
+ precedence:4,
+ tokenise:detectPathToken,
+ parse: function(){},
+ evaluate: function(scope){
+ this.result = get(resolvePath(scope.get('_gediModelContext_'), this.original), model);
+ }
+ });
+
+ gel.scope.isDirty = function(scope, args){
+ var pathToken = args.raw()[0];
- gel.tokenConverters.push({
- name: 'gediPathToken',
- precedence:4,
- tokenise:detectPathToken,
- parse: function(){},
- evaluate: function(scope){
- this.result = get(resolvePath(scope.get('_gediModelContext_'), this.original), model);
- }
- });
+ return isDirty((pathToken && pathToken.name === 'gediPathToken') ? pathToken.original : new Path());
+ }
- gel.scope.isDirty = function(scope, args){
- var pathToken = args.raw()[0];
+ gel.scope.getAllDirty = function (scope, args) {
+ var pathToken = args.raw()[0],
+ path = resolvePath(scope.get('_gediModelContext_'), (pathToken && pathToken.name === 'gediPathToken') && pathToken.original),
+ source = get(path, model),
+ result,
+ itemPath;
- return isDirty((pathToken && pathToken.name === 'gediPathToken') ? pathToken.original : new Path());
+ if (source == null) {
+ return null;
}
- gel.scope.getAllDirty = function (scope, args) {
- var pathToken = args.raw()[0],
- path = resolvePath(scope.get('_gediModelContext_'), (pathToken && pathToken.name === 'gediPathToken') && pathToken.original),
- source = get(path, model),
- result,
- itemPath;
-
- if (source == null) {
- return null;
- }
-
- result = source.constructor();
+ result = source.constructor();
- for (var key in source) {
- if (source.hasOwnProperty(key)) {
- itemPath = resolvePath(path, key);
- if (result instanceof Array) {
- isDirty(itemPath) && result.push(source[key]);
- } else {
- isDirty(itemPath) && (result[key] = source[key]);
- }
+ for (var key in source) {
+ if (source.hasOwnProperty(key)) {
+ itemPath = resolvePath(path, key);
+ if (result instanceof Array) {
+ isDirty(itemPath) && result.push(source[key]);
+ } else {
+ isDirty(itemPath) && (result[key] = source[key]);
}
}
+ }
- return result;
- };
- }
+ return result;
+ };
//***********************************************
//
@@ -1023,23 +1024,11 @@
self.original = expression;
if (typeof expression === "string") {
- if(gel){
//passed a string or array? make a new Expression.
- var tokens = gel.tokenise(expression);
- fastEach(tokens, function (key) {
- self.push(key);
- });
- }else{
- var path = Path.parse(expression);
-
- if(path.toString() !== expression){
- throw exceptions.expressionsRequireGel;
- }
-
- fastEach(path, function(key){
- self.push(key);
- });
- }
+ var tokens = gel.tokenise(expression);
+ fastEach(tokens, function (key) {
+ self.push(key);
+ });
}
self.paths = getPathsInExpression(self);
}
@@ -1107,4 +1096,4 @@
}
return gediConstructor;
-})();
+}));
View
@@ -5,7 +5,7 @@
"tags": [
"DOM"
],
- "version": "0.1.1",
+ "version": "0.1.2",
"main": "gedi.js",
"dependencies": {
"gel-js":">= 0.0.0"
Oops, something went wrong.

0 comments on commit 94d7ae7

Please sign in to comment.