Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix externs.js and the exported symbols #216

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/datascript/db.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@
(assoc [d k v] (assoc-datom d k v))
]))

#?(:cljs (goog/exportSymbol "datascript.db.Datom" Datom))

(defn ^Datom datom
([e a v] (Datom. e a v tx0 true))
([e a v tx] (Datom. e a v tx true))
Expand Down
26 changes: 17 additions & 9 deletions src/datascript/externs.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
var datascript = {};
datascript.db = {};
datascript.db.Datom = {};
datascript.db.Datom.e = 0;
datascript.db.Datom.a = "";
datascript.db.Datom.v = "";
datascript.db.Datom.tx = 0;
datascript.db.Datom.added = true;

/**
* @constructor
*/
datascript.db.Datom = function() {};
datascript.db.Datom.prototype.e;
datascript.db.Datom.prototype.a;
datascript.db.Datom.prototype.v;
datascript.db.Datom.prototype.tx;
datascript.db.Datom.prototype.added;


datascript.impl = {};
datascript.impl.entity = {};
datascript.impl.entity.Entity = {};
datascript.impl.entity.Entity.db = {};
datascript.impl.entity.Entity.eid = {};

/**
* @constructor
*/
datascript.impl.entity.Entity = function() {};
datascript.impl.entity.Entity.prototype.db;
datascript.impl.entity.Entity.prototype.eid;
datascript.impl.entity.Entity.prototype.keys = function() {};
datascript.impl.entity.Entity.prototype.entries = function() {};
datascript.impl.entity.Entity.prototype.values = function() {};
Expand Down
15 changes: 1 addition & 14 deletions src/datascript/impl/entity.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,4 @@
(vreset! (.-touched e) true)))
e)

#?(:cljs (do
(goog/exportSymbol "datascript.impl.entity.Entity.prototype.get" (.-get (.-prototype Entity)))
(goog/exportSymbol "datascript.impl.entity.Entity.prototype.has" (.-has (.-prototype Entity)))
(goog/exportSymbol "datascript.impl.entity.Entity.prototype.forEach" (.-forEach (.-prototype Entity)))
(goog/exportSymbol "datascript.impl.entity.Entity.prototype.key_set" (.-key_set (.-prototype Entity)))
(goog/exportSymbol "datascript.impl.entity.Entity.prototype.value_set" (.-value_set (.-prototype Entity)))
(goog/exportSymbol "datascript.impl.entity.Entity.prototype.entry_set" (.-entry_set (.-prototype Entity)))
(goog/exportSymbol "datascript.impl.entity.Entity.prototype.keys" (.-keys (.-prototype Entity)))
(goog/exportSymbol "datascript.impl.entity.Entity.prototype.values" (.-values (.-prototype Entity)))
(goog/exportSymbol "datascript.impl.entity.Entity.prototype.entries" (.-entries (.-prototype Entity)))

(goog/exportSymbol "cljs.core.ES6Iterator.prototype.next" (.-next (.-prototype cljs.core/ES6Iterator)))
(goog/exportSymbol "cljs.core.ES6EntriesIterator.prototype.next" (.-next (.-prototype cljs.core/ES6EntriesIterator)))
))
#?(:cljs (goog/exportSymbol "datascript.impl.entity.Entity" Entity))