Skip to content
Browse files

GHUB-5 Removing globals

* Letting users define their own globals
  • Loading branch information...
1 parent 8386828 commit dfc47deaec24126067447ea78d70185f5d6a15df @goatslacker committed Jun 30, 2011
Showing with 11 additions and 8 deletions.
  1. +2 −5 src/vql.js
  2. +1 −1 src/web.db.js
  3. +8 −2 test/VenomSpec.js
View
7 src/vql.js
@@ -5,7 +5,7 @@
* @param {Object} schema The object's schema
* @returns {Object}
*/
-Snake.venomousObject = function (schema) {
+Snake.collection = function (schema) {
/**
* @private
*/
@@ -643,7 +643,4 @@ Snake.venomousObject = function (schema) {
return Collection;
};
-Snake.venom = {};
-
-var venom = Snake.venom,
- vql = venom;
+Snake.vql = {};
View
2 src/web.db.js
@@ -157,7 +157,7 @@ Snake.loadFromJSON = function (schema, onComplete, create_tables) {
models.push(model);
- Snake.venom[schema[table].tableName] = new Snake.venomousObject(model);
+ Snake.vql[schema[table].tableName] = new Snake.collection(model);
}
}
View
10 test/VenomSpec.js
@@ -14,8 +14,14 @@ describe("Snake", function () {
// vql.js
describe("VQL", function () {
- it("Venom should be defined", function () {
- expect(venom).toBeDefined();
+ var vql = null;
+
+ beforeEach(function () {
+ vql = Snake.vql;
+ });
+
+ it("VQL should be defined", function () {
+ expect(vql).not.toBeNull();
});
// Run through venom and return the SQL query

0 comments on commit dfc47de

Please sign in to comment.
Something went wrong with that request. Please try again.