tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkupp...@apache.org
Subject [27/50] [abbrv] tinkerpop git commit: Include T deserializer
Date Tue, 30 Jan 2018 15:30:47 GMT
Include T deserializer


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f2f9729c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f2f9729c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f2f9729c

Branch: refs/heads/TINKERPOP-1873
Commit: f2f9729cd5ca295bcaa3d445878f0cbdd7b5ee6c
Parents: 3553ea9
Author: Jorge Bay Gondra <jorgebaygondra@gmail.com>
Authored: Wed Jan 17 16:52:05 2018 +0100
Committer: Jorge Bay Gondra <jorgebaygondra@gmail.com>
Committed: Fri Jan 19 09:30:18 2018 +0100

----------------------------------------------------------------------
 gremlin-javascript/glv/TraversalSource.template               | 4 ++++
 .../javascript/gremlin-javascript/lib/process/traversal.js    | 4 ++++
 .../gremlin-javascript/lib/structure/io/graph-serializer.js   | 3 ++-
 .../gremlin-javascript/lib/structure/io/type-serializers.js   | 7 +++++++
 4 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f2f9729c/gremlin-javascript/glv/TraversalSource.template
----------------------------------------------------------------------
diff --git a/gremlin-javascript/glv/TraversalSource.template b/gremlin-javascript/glv/TraversalSource.template
index d707a42..3f289e4 100644
--- a/gremlin-javascript/glv/TraversalSource.template
+++ b/gremlin-javascript/glv/TraversalSource.template
@@ -182,6 +182,10 @@ class EnumValue {
     this.typeName = typeName;
     this.elementName = elementName;
   }
+
+  toString() {
+    return this.elementName;
+  }
 }
 
 module.exports = {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f2f9729c/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
index 2877f02..a8d066a 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
@@ -242,6 +242,10 @@ class EnumValue {
     this.typeName = typeName;
     this.elementName = elementName;
   }
+
+  toString() {
+    return this.elementName;
+  }
 }
 
 module.exports = {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f2f9729c/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js
b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js
index 3dbd340..df05659 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js
@@ -159,7 +159,8 @@ const deserializers = {
   'g:Edge': typeSerializers.EdgeSerializer,
   'g:VertexProperty': typeSerializers.VertexPropertySerializer,
   'g:Property': typeSerializers.PropertySerializer,
-  'g:Path': typeSerializers.PathSerializer
+  'g:Path': typeSerializers.PathSerializer,
+  'g:T': typeSerializers.TSerializer
 };
 
 const serializers = [

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f2f9729c/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js
b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js
index d6f131c..304888f 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js
@@ -270,6 +270,12 @@ class PathSerializer extends TypeSerializer {
   }
 }
 
+class TSerializer extends TypeSerializer {
+  deserialize(obj) {
+    return t.t[obj[valueKey]];
+  }
+}
+
 module.exports = {
   BytecodeSerializer,
   EdgeSerializer,
@@ -280,6 +286,7 @@ module.exports = {
   PathSerializer,
   PropertySerializer,
   PSerializer,
+  TSerializer,
   TraverserSerializer,
   typeKey,
   valueKey,


Mime
View raw message