Skip to content

Commit 957f05d

Browse files
committed
fix non-extendable objects regression of 1.1.0
Closes Leaflet#5650 until we figure out a less hacky solution.
1 parent eb95728 commit 957f05d

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
sudo: false
22
language: node_js
33
node_js:
4-
- 4
4+
- node
55
addons:
66
artifacts:
77
paths:

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414
"karma-firefox-launcher": "~1.0.0",
1515
"karma-mocha": "^1.2.0",
1616
"karma-phantomjs-launcher": "^1.0.2",
17-
"karma-rollup-plugin": "^0.2.4",
17+
"karma-rollup-preprocessor": "^4.0.1",
1818
"karma-safari-launcher": "~1.0.0",
1919
"leafdoc": "^1.4.1",
2020
"mocha": "^3.1.0",
2121
"phantomjs-prebuilt": "^2.1.12",
2222
"prosthetic-hand": "^1.3.1",
23-
"rollup": "^0.41.4",
23+
"rollup": "^0.45.2",
2424
"rollup-plugin-git-version": "0.2.1",
2525
"rollup-plugin-json": "^2.1.0",
26-
"rollup-watch": "^2.5.0",
26+
"rollup-watch": "^4.3.1",
2727
"source-map": "^0.5.6",
2828
"ssri": "^4.1.2",
29-
"uglify-js": "~2.7.3"
29+
"uglify-js": "~3.0.26"
3030
},
3131
"main": "dist/leaflet-src.js",
3232
"style": "dist/leaflet.css",

spec/karma.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = function (config) {
2525
basePath: '../',
2626

2727
plugins: [
28-
'karma-rollup-plugin',
28+
'karma-rollup-preprocessor',
2929
'karma-mocha',
3030
'karma-coverage',
3131
'karma-phantomjs-launcher',

spec/suites/core/GeneralSpec.js

+6
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@ describe('General', function () {
88

99
expect(L.noConflict()).to.eql(leaflet);
1010
});
11+
12+
describe('namespace extension', function () {
13+
L.Util.foo = 'bar';
14+
15+
expect(L.Util.foo).to.eql('bar');
16+
});
1117
});

src/Leaflet.js

+3
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ export function noConflict() {
3333

3434
// Always export us to window global (see #2364)
3535
window.L = exports;
36+
37+
import {freeze} from './core/Util';
38+
Object.freeze = freeze;

src/core/Util.js

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* Various utility functions, used by Leaflet internally.
55
*/
66

7+
export var freeze = Object.freeze;
8+
Object.freeze = function (obj) { return obj; };
9+
710
// @function extend(dest: Object, src?: Object): Object
811
// Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.
912
export function extend(dest) {

0 commit comments

Comments
 (0)