sirikata / protojs Goto Github PK
View Code? Open in Web Editor NEWThis project forked from danielrh/protojs
Protobuf implementation in javascript
Home Page: http://sirikata.com
License: Other
This project forked from danielrh/protojs
Protobuf implementation in javascript
Home Page: http://sirikata.com
License: Other
e.g. where pbj would fail
message XMLNotification {
required string message = 1;
}
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [pbj] Error 1
http://www.antlr.org/download/C/libantlr3c-3.2.tar.gz
description The requested resource (/download/C/libantlr3c-3.2.tar.gz) is not available.
for pbj file , if I delete the line
"package ProtoJSTest.PB;"
for the generated file :"Test.pbj.js"
there are many javascript errors
The definition of PROTO.DefineProperty calls PROTO.warn on lines 83 and 87 of protobuf.js. However, PROTO.warn is not defined until line 118. If a browser like IE8 does not support DefineProperty, then it will attempt to call PROTO.warn before it's defined.
With this proto file:
package Test; message MyTest { enum MyTestEnum { ZERO = 0 ; ONE = 1 ; } optional MyTestEnum value = 2 [default = ZERO]; }
...I get this JS output:
"use strict"; /** @suppress {duplicate}*/var Test; if (typeof(Test)=="undefined") {Test = {};} Test.MyTest = PROTO.Message("Test.MyTest",{ MyTestEnum: PROTO.Enum("Test.MyTest.MyTestEnum",{ ZERO :0, ONE :1 }), value: { options: {default_value:Test.MyTest.MyTestEnum.ZERO}, multiplicity: PROTO.optional, type: function(){return Test.MyTest.MyTestEnum;}, id: 2 }});
...which produces (in Firefox):
TypeError: Test.MyTest is undefined
...and in Chrome:
Uncaught TypeError: Cannot read property 'MyTestEnum' of undefined
...in both cases, the offending line is:
options: {default_value:Test.MyTest.MyTestEnum.ZERO},
...changing the default value from the enum "ZERO" to a literal value of "0" fixes the problem.
This .proto file works fine in at least three other protobuf systems - so I presume that it's legal.
can you package this as a nodejs module?
When compiling the script with the google closure tools, the following warnings occur:
inc\third_party\protobuf.js:1175: WARNING - Comparison again NaN is always false. Did you mean isNaN()?
if (n == NaN) {
^
inc\third_party\protobuf.js:1188: WARNING - Comparison again NaN is always false. Did you mean isNaN()?
if (n == NaN) {
^
inc\third_party\protobuf.js:1339: WARNING - Comparison again NaN is always false. Did you mean isNaN()?
if (n == NaN) {
^
According to the compiler, isNaN should be used in this code.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.