Merge pull request #3029 from fredj/update-closure
Update closure compiler and library
This commit is contained in:
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"library_url": "https://github.com/google/closure-library/archive/fb35d5232edef340dd9a7c6e479556829d0fa452.zip"
|
"library_url": "https://github.com/google/closure-library/archive/5b7a6ce1974c230dc169cb93ed5f9689e880aa50.zip"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"async": "0.9.0",
|
"async": "0.9.0",
|
||||||
"closure-util": "1.1.0",
|
"closure-util": "1.2.0",
|
||||||
"fs-extra": "0.12.0",
|
"fs-extra": "0.12.0",
|
||||||
"graceful-fs": "3.0.2",
|
"graceful-fs": "3.0.2",
|
||||||
"htmlparser2": "3.7.3",
|
"htmlparser2": "3.7.3",
|
||||||
|
|||||||
@@ -37,25 +37,6 @@ ol.array.binaryFindNearest = function(arr, target) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Safe version of goog.array.extend that does not risk to overflow the stack
|
|
||||||
* even if `array2` contains a large number of elements.
|
|
||||||
*
|
|
||||||
* @param {Array.<T>} array1 Array 1.
|
|
||||||
* @param {Array.<T>} array2 Array 2.
|
|
||||||
* @template T
|
|
||||||
*/
|
|
||||||
ol.array.safeExtend = function(array1, array2) {
|
|
||||||
// goog.array.extend uses Array.prototype.push.apply, which can overflow the
|
|
||||||
// stack if array2 contains too many elements. Repeatedly calling push
|
|
||||||
// performs as well on modern browsers.
|
|
||||||
var i, ii;
|
|
||||||
for (i = 0, ii = array2.length; i < ii; ++i) {
|
|
||||||
array1.push(array2[i]);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>} arr Array.
|
* @param {Array.<number>} arr Array.
|
||||||
* @param {number} target Target.
|
* @param {number} target Target.
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
goog.provide('ol.format.GML');
|
goog.provide('ol.format.GML');
|
||||||
goog.provide('ol.format.GML3');
|
goog.provide('ol.format.GML3');
|
||||||
|
|
||||||
|
goog.require('goog.array');
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
goog.require('goog.dom');
|
||||||
goog.require('goog.dom.NodeType');
|
goog.require('goog.dom.NodeType');
|
||||||
goog.require('goog.object');
|
goog.require('goog.object');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.array');
|
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.format.Feature');
|
goog.require('ol.format.Feature');
|
||||||
goog.require('ol.format.GMLBase');
|
goog.require('ol.format.GMLBase');
|
||||||
@@ -283,7 +283,7 @@ ol.format.GML3.prototype.readSurface_ = function(node, objectStack) {
|
|||||||
var ends = [flatCoordinates.length];
|
var ends = [flatCoordinates.length];
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 1, ii = flatLinearRings.length; i < ii; ++i) {
|
for (i = 1, ii = flatLinearRings.length; i < ii; ++i) {
|
||||||
ol.array.safeExtend(flatCoordinates, flatLinearRings[i]);
|
goog.array.extend(flatCoordinates, flatLinearRings[i]);
|
||||||
ends.push(flatCoordinates.length);
|
ends.push(flatCoordinates.length);
|
||||||
}
|
}
|
||||||
polygon.setFlatCoordinates(
|
polygon.setFlatCoordinates(
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
// envelopes/extents, only geometries!
|
// envelopes/extents, only geometries!
|
||||||
goog.provide('ol.format.GMLBase');
|
goog.provide('ol.format.GMLBase');
|
||||||
|
|
||||||
|
goog.require('goog.array');
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
goog.require('goog.dom');
|
||||||
goog.require('goog.dom.NodeType');
|
goog.require('goog.dom.NodeType');
|
||||||
goog.require('goog.object');
|
goog.require('goog.object');
|
||||||
goog.require('goog.string');
|
goog.require('goog.string');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.array');
|
|
||||||
goog.require('ol.format.Feature');
|
goog.require('ol.format.Feature');
|
||||||
goog.require('ol.format.XMLFeature');
|
goog.require('ol.format.XMLFeature');
|
||||||
goog.require('ol.geom.Geometry');
|
goog.require('ol.geom.Geometry');
|
||||||
@@ -390,7 +390,7 @@ ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) {
|
|||||||
var ends = [flatCoordinates.length];
|
var ends = [flatCoordinates.length];
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 1, ii = flatLinearRings.length; i < ii; ++i) {
|
for (i = 1, ii = flatLinearRings.length; i < ii; ++i) {
|
||||||
ol.array.safeExtend(flatCoordinates, flatLinearRings[i]);
|
goog.array.extend(flatCoordinates, flatLinearRings[i]);
|
||||||
ends.push(flatCoordinates.length);
|
ends.push(flatCoordinates.length);
|
||||||
}
|
}
|
||||||
polygon.setFlatCoordinates(
|
polygon.setFlatCoordinates(
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ goog.require('goog.math');
|
|||||||
goog.require('goog.object');
|
goog.require('goog.object');
|
||||||
goog.require('goog.string');
|
goog.require('goog.string');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.array');
|
|
||||||
goog.require('ol.color');
|
goog.require('ol.color');
|
||||||
goog.require('ol.feature');
|
goog.require('ol.feature');
|
||||||
goog.require('ol.format.Feature');
|
goog.require('ol.format.Feature');
|
||||||
@@ -850,7 +849,7 @@ ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
|
|||||||
geometry = geometries[i];
|
geometry = geometries[i];
|
||||||
goog.asserts.assertInstanceof(geometry, ol.geom.Point);
|
goog.asserts.assertInstanceof(geometry, ol.geom.Point);
|
||||||
goog.asserts.assert(geometry.getLayout() == layout);
|
goog.asserts.assert(geometry.getLayout() == layout);
|
||||||
ol.array.safeExtend(flatCoordinates, geometry.getFlatCoordinates());
|
goog.array.extend(flatCoordinates, geometry.getFlatCoordinates());
|
||||||
}
|
}
|
||||||
var multiPoint = new ol.geom.MultiPoint(null);
|
var multiPoint = new ol.geom.MultiPoint(null);
|
||||||
multiPoint.setFlatCoordinates(layout, flatCoordinates);
|
multiPoint.setFlatCoordinates(layout, flatCoordinates);
|
||||||
@@ -916,7 +915,7 @@ ol.format.KML.readPolygon_ = function(node, objectStack) {
|
|||||||
var ends = [flatCoordinates.length];
|
var ends = [flatCoordinates.length];
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 1, ii = flatLinearRings.length; i < ii; ++i) {
|
for (i = 1, ii = flatLinearRings.length; i < ii; ++i) {
|
||||||
ol.array.safeExtend(flatCoordinates, flatLinearRings[i]);
|
goog.array.extend(flatCoordinates, flatLinearRings[i]);
|
||||||
ends.push(flatCoordinates.length);
|
ends.push(flatCoordinates.length);
|
||||||
}
|
}
|
||||||
polygon.setFlatCoordinates(
|
polygon.setFlatCoordinates(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
goog.provide('ol.geom.LineString');
|
goog.provide('ol.geom.LineString');
|
||||||
|
|
||||||
|
goog.require('goog.array');
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('ol.array');
|
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.geom.GeometryType');
|
goog.require('ol.geom.GeometryType');
|
||||||
goog.require('ol.geom.SimpleGeometry');
|
goog.require('ol.geom.SimpleGeometry');
|
||||||
@@ -69,7 +69,7 @@ ol.geom.LineString.prototype.appendCoordinate = function(coordinate) {
|
|||||||
if (goog.isNull(this.flatCoordinates)) {
|
if (goog.isNull(this.flatCoordinates)) {
|
||||||
this.flatCoordinates = coordinate.slice();
|
this.flatCoordinates = coordinate.slice();
|
||||||
} else {
|
} else {
|
||||||
ol.array.safeExtend(this.flatCoordinates, coordinate);
|
goog.array.extend(this.flatCoordinates, coordinate);
|
||||||
}
|
}
|
||||||
this.changed();
|
this.changed();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
goog.provide('ol.geom.MultiLineString');
|
goog.provide('ol.geom.MultiLineString');
|
||||||
|
|
||||||
|
goog.require('goog.array');
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('ol.array');
|
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.geom.GeometryType');
|
goog.require('ol.geom.GeometryType');
|
||||||
goog.require('ol.geom.LineString');
|
goog.require('ol.geom.LineString');
|
||||||
@@ -63,7 +63,7 @@ ol.geom.MultiLineString.prototype.appendLineString = function(lineString) {
|
|||||||
if (goog.isNull(this.flatCoordinates)) {
|
if (goog.isNull(this.flatCoordinates)) {
|
||||||
this.flatCoordinates = lineString.getFlatCoordinates().slice();
|
this.flatCoordinates = lineString.getFlatCoordinates().slice();
|
||||||
} else {
|
} else {
|
||||||
ol.array.safeExtend(
|
goog.array.extend(
|
||||||
this.flatCoordinates, lineString.getFlatCoordinates().slice());
|
this.flatCoordinates, lineString.getFlatCoordinates().slice());
|
||||||
}
|
}
|
||||||
this.ends_.push(this.flatCoordinates.length);
|
this.ends_.push(this.flatCoordinates.length);
|
||||||
@@ -212,7 +212,7 @@ ol.geom.MultiLineString.prototype.getFlatMidpoints = function() {
|
|||||||
var end = ends[i];
|
var end = ends[i];
|
||||||
var midpoint = ol.geom.flat.interpolate.lineString(
|
var midpoint = ol.geom.flat.interpolate.lineString(
|
||||||
flatCoordinates, offset, end, stride, 0.5);
|
flatCoordinates, offset, end, stride, 0.5);
|
||||||
ol.array.safeExtend(midpoints, midpoint);
|
goog.array.extend(midpoints, midpoint);
|
||||||
offset = end;
|
offset = end;
|
||||||
}
|
}
|
||||||
return midpoints;
|
return midpoints;
|
||||||
@@ -313,7 +313,7 @@ ol.geom.MultiLineString.prototype.setLineStrings = function(lineStrings) {
|
|||||||
// FIXME better handle the case of non-matching layouts
|
// FIXME better handle the case of non-matching layouts
|
||||||
goog.asserts.assert(lineString.getLayout() == layout);
|
goog.asserts.assert(lineString.getLayout() == layout);
|
||||||
}
|
}
|
||||||
ol.array.safeExtend(flatCoordinates, lineString.getFlatCoordinates());
|
goog.array.extend(flatCoordinates, lineString.getFlatCoordinates());
|
||||||
ends.push(flatCoordinates.length);
|
ends.push(flatCoordinates.length);
|
||||||
}
|
}
|
||||||
this.setFlatCoordinates(layout, flatCoordinates, ends);
|
this.setFlatCoordinates(layout, flatCoordinates, ends);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
goog.provide('ol.geom.MultiPoint');
|
goog.provide('ol.geom.MultiPoint');
|
||||||
|
|
||||||
|
goog.require('goog.array');
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('ol.array');
|
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.geom.GeometryType');
|
goog.require('ol.geom.GeometryType');
|
||||||
goog.require('ol.geom.Point');
|
goog.require('ol.geom.Point');
|
||||||
@@ -39,7 +39,7 @@ ol.geom.MultiPoint.prototype.appendPoint = function(point) {
|
|||||||
if (goog.isNull(this.flatCoordinates)) {
|
if (goog.isNull(this.flatCoordinates)) {
|
||||||
this.flatCoordinates = point.getFlatCoordinates().slice();
|
this.flatCoordinates = point.getFlatCoordinates().slice();
|
||||||
} else {
|
} else {
|
||||||
ol.array.safeExtend(this.flatCoordinates, point.getFlatCoordinates());
|
goog.array.extend(this.flatCoordinates, point.getFlatCoordinates());
|
||||||
}
|
}
|
||||||
this.changed();
|
this.changed();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
goog.provide('ol.geom.MultiPolygon');
|
goog.provide('ol.geom.MultiPolygon');
|
||||||
|
|
||||||
|
goog.require('goog.array');
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('ol.array');
|
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.geom.GeometryType');
|
goog.require('ol.geom.GeometryType');
|
||||||
goog.require('ol.geom.MultiPoint');
|
goog.require('ol.geom.MultiPoint');
|
||||||
@@ -97,7 +97,7 @@ ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) {
|
|||||||
this.endss_.push();
|
this.endss_.push();
|
||||||
} else {
|
} else {
|
||||||
var offset = this.flatCoordinates.length;
|
var offset = this.flatCoordinates.length;
|
||||||
ol.array.safeExtend(this.flatCoordinates, polygon.getFlatCoordinates());
|
goog.array.extend(this.flatCoordinates, polygon.getFlatCoordinates());
|
||||||
ends = polygon.getEnds().slice();
|
ends = polygon.getEnds().slice();
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 0, ii = ends.length; i < ii; ++i) {
|
for (i = 0, ii = ends.length; i < ii; ++i) {
|
||||||
@@ -397,7 +397,7 @@ ol.geom.MultiPolygon.prototype.setPolygons = function(polygons) {
|
|||||||
for (j = 0, jj = ends.length; j < jj; ++j) {
|
for (j = 0, jj = ends.length; j < jj; ++j) {
|
||||||
ends[j] += offset;
|
ends[j] += offset;
|
||||||
}
|
}
|
||||||
ol.array.safeExtend(flatCoordinates, polygon.getFlatCoordinates());
|
goog.array.extend(flatCoordinates, polygon.getFlatCoordinates());
|
||||||
endss.push(ends);
|
endss.push(ends);
|
||||||
}
|
}
|
||||||
this.setFlatCoordinates(layout, flatCoordinates, endss);
|
this.setFlatCoordinates(layout, flatCoordinates, endss);
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ goog.provide('ol.geom.Polygon');
|
|||||||
|
|
||||||
goog.require('goog.array');
|
goog.require('goog.array');
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('ol.array');
|
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.geom.GeometryType');
|
goog.require('ol.geom.GeometryType');
|
||||||
goog.require('ol.geom.LinearRing');
|
goog.require('ol.geom.LinearRing');
|
||||||
@@ -92,7 +91,7 @@ ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) {
|
|||||||
if (goog.isNull(this.flatCoordinates)) {
|
if (goog.isNull(this.flatCoordinates)) {
|
||||||
this.flatCoordinates = linearRing.getFlatCoordinates().slice();
|
this.flatCoordinates = linearRing.getFlatCoordinates().slice();
|
||||||
} else {
|
} else {
|
||||||
ol.array.safeExtend(this.flatCoordinates, linearRing.getFlatCoordinates());
|
goog.array.extend(this.flatCoordinates, linearRing.getFlatCoordinates());
|
||||||
}
|
}
|
||||||
this.ends_.push(this.flatCoordinates.length);
|
this.ends_.push(this.flatCoordinates.length);
|
||||||
this.changed();
|
this.changed();
|
||||||
|
|||||||
+3
-11
@@ -12,6 +12,7 @@ goog.require('goog.events');
|
|||||||
goog.require('goog.events.Event');
|
goog.require('goog.events.Event');
|
||||||
goog.require('goog.functions');
|
goog.require('goog.functions');
|
||||||
goog.require('goog.object');
|
goog.require('goog.object');
|
||||||
|
goog.require('goog.string');
|
||||||
goog.require('ol.Observable');
|
goog.require('ol.Observable');
|
||||||
|
|
||||||
|
|
||||||
@@ -223,15 +224,6 @@ ol.Object.getterNameCache_ = {};
|
|||||||
ol.Object.setterNameCache_ = {};
|
ol.Object.setterNameCache_ = {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string} str String.
|
|
||||||
* @return {string} Capitalized string.
|
|
||||||
*/
|
|
||||||
ol.Object.capitalize = function(str) {
|
|
||||||
return str.substr(0, 1).toUpperCase() + str.substr(1);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} key Key name.
|
* @param {string} key Key name.
|
||||||
* @return {string} Change name.
|
* @return {string} Change name.
|
||||||
@@ -250,7 +242,7 @@ ol.Object.getChangeEventType = function(key) {
|
|||||||
ol.Object.getGetterName = function(key) {
|
ol.Object.getGetterName = function(key) {
|
||||||
return ol.Object.getterNameCache_.hasOwnProperty(key) ?
|
return ol.Object.getterNameCache_.hasOwnProperty(key) ?
|
||||||
ol.Object.getterNameCache_[key] :
|
ol.Object.getterNameCache_[key] :
|
||||||
(ol.Object.getterNameCache_[key] = 'get' + ol.Object.capitalize(key));
|
(ol.Object.getterNameCache_[key] = 'get' + goog.string.capitalize(key));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -261,7 +253,7 @@ ol.Object.getGetterName = function(key) {
|
|||||||
ol.Object.getSetterName = function(key) {
|
ol.Object.getSetterName = function(key) {
|
||||||
return ol.Object.setterNameCache_.hasOwnProperty(key) ?
|
return ol.Object.setterNameCache_.hasOwnProperty(key) ?
|
||||||
ol.Object.setterNameCache_[key] :
|
ol.Object.setterNameCache_[key] :
|
||||||
(ol.Object.setterNameCache_[key] = 'set' + ol.Object.capitalize(key));
|
(ol.Object.setterNameCache_[key] = 'set' + goog.string.capitalize(key));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user