commit | c88a07385288e5a3080faa6ba495519d3cb491f8 | [log] [tgz] |
---|---|---|
author | Alex Fandrianto <alexfandrianto@google.com> | Tue May 12 11:18:37 2015 -0700 |
committer | Alex Fandrianto <alexfandrianto@google.com> | Tue May 12 11:19:50 2015 -0700 |
tree | f6565fba053c3dbee457ed8183cd435fb61c2988 | |
parent | 3875f46123533b22f0d54354c7e0d4f2ba1c3ad7 [diff] |
js/core: Extension Caveat tab race fix Fix race with the account name. By "locking" early (not in a callback) and setting the account name immediately, we ensure that any later getCaveats calls will reuse the same outstanding request tab. Removed unnecessary the authState flag and corresponding check. Was this needed? It's a random value, so any (racing) tabs won't know it's actual value. We also have requestId if we need things to be unique. Removed unnecessary _lastRequestId and requestId. The former was an internal tracking variable that was unused. The latter was sent in the url, but was also unused. (Tested on HelloPeer using the build-dev extension.) Change-Id: I2e9fd7dac3191c3e3c91b5e49aaf6d5cf24eaa42
This repository defines the JavaScript API for Vanadium. The client and server APIs defined here work both in Node.js and the browser.
npm
can be used to install this library:
npm install --save git@github.com:vanadium/js.git
Documentation for this API is available at https://jsdoc.v.io/ Tutorials can be found at https://v.io/tutorials/javascript/
The entry point to the API is through a module called vanadium
, everything else is considered private and should not be accessed by the users of the API.
The vanadium
module is exported as a global in the browser JavaScript library and for Browserify and Node.js the “main” property in the package.json
points to /src/vanadium
making it the index module and therefore Browserify and Node.js users can gain access to the API with:
var vanadium = require("vanadium");
One of the goals of this project is to only write the code once and have it run in both Node.js and browsers. Therefore, specific build and testing steps have been designed in the project to ensure this goal.
When run in a browser, vanadium.js
expects that the vanadium extension will be installed.
Bugs and feature requests should be filed in the Vanadium issue tracker.
GNU Make is used to build and test Vanadium.
Build everything:
make build
Test everything:
make test
Run a specific test suite:
make test-unit make test-unit-node make test-unit-browser make test-integration make test-integration-node make test-integration-browser
Remove all build and testing artifacts:
make clean