INNER CODE UNIT · JavaScript
Map
mapbox/mapbox-gl-native · platform/node/index.js:8
var Map = function(options) {
if (!(options instanceof Object)) {
throw TypeError("Requires an options object as first argument");
}
if (!options.hasOwnProperty('request') || !(options.request instanceof Function)) {
throw TypeError("Options object must have a 'request' method");
}
var request = options.request;
return new constructor(Object.assign(options, {
request: function(req) {
// Protect against `request` implementations that call the callback synchronously,
// call it multiple times, or throw exceptions.
// http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony
var responded = false;