Skip to content

Commit d3878f0

Browse files
author
Ben Newman
committed
Rename ecmascript-collections to ecmascript-runtime, and add more to it.
Now that we're including more than just collections-related polyfills, a more generic name seems appropriate.
1 parent 60eaf91 commit d3878f0

File tree

12 files changed

+84
-42
lines changed

12 files changed

+84
-42
lines changed

History.md

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
IDs. `Random.id()` can still be used to generate crpytographically
88
secure document IDs. [#5161](https://github.com/meteor/meteor/issues/5161)
99

10+
* The `ecmascript-collections` package has been renamed to
11+
`ecmascript-runtime` and now includes a more complete selection of
12+
ES2015 polyfills and shims from [`core-js`](https://www.npmjs.com/package/core-js).
13+
The complete list can be found
14+
[here](https://github.com/meteor/ecmascript-runtime/blob/master/server.js).
15+
1016
## v1.2.0.2, 2015-Sept-28
1117

1218
* Update Crosswalk plugin for Cordova to 1.3.1. [#5267](https://github.com/meteor/meteor/issues/5267)

packages/ecmascript-collections/README.md

-3
This file was deleted.

packages/ecmascript-collections/collections.js

-3
This file was deleted.

packages/ecmascript-collections/package.js

-32
This file was deleted.

packages/ecmascript-collections/.npm/package/npm-shrinkwrap.json packages/ecmascript-runtime/.npm/package/npm-shrinkwrap.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ecmascript-runtime/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ecmascript-runtime [![Build Status](https://travis-ci.org/meteor/ecmascript-runtime.svg?branch=master)](https://travis-ci.org/meteor/ecmascript-runtime)
2+
3+
Polyfills for new ECMAScript 2015 APIs like Map and Set
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Package.describe({
2+
name: "ecmascript-runtime",
3+
version: "0.2.6",
4+
summary: "Polyfills for new ECMAScript 2015 APIs like Map and Set",
5+
git: "https://github.com/meteor/ecmascript-runtime",
6+
documentation: "README.md"
7+
});
8+
9+
Npm.depends({
10+
"meteor-ecmascript-runtime": "0.2.6"
11+
});
12+
13+
Package.onUse(function(api) {
14+
api.addFiles("runtime.js", "server");
15+
16+
api.addFiles(
17+
".npm/package/node_modules/meteor-ecmascript-runtime/client.js",
18+
"client",
19+
{ bare: true }
20+
);
21+
22+
api.export("Symbol");
23+
api.export("Map");
24+
api.export("Set");
25+
});
26+
27+
Package.onTest(function(api) {
28+
api.use("tinytest");
29+
api.use("check");
30+
api.use("es5-shim");
31+
api.use("ecmascript-runtime");
32+
api.addFiles("runtime-tests.js");
33+
});

packages/ecmascript-collections/collections-tests.js packages/ecmascript-runtime/runtime-tests.js

+33
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,36 @@ Tinytest.add("core-js - Number", function () {
5555
// problem for us.
5656
check(1234, Number);
5757
});
58+
59+
Tinytest.add("core-js - Object", function (test) {
60+
test.equal(typeof Object.assign, "function");
61+
test.equal(typeof Object.is, "function");
62+
test.equal(typeof Object.setPrototypeOf, "function");
63+
test.equal(typeof Object.getPrototypeOf, "function");
64+
});
65+
66+
Tinytest.add("core-js - String", function (test) {
67+
test.equal(typeof "asdf".startsWith, "function");
68+
test.equal(typeof "asdf".endsWith, "function");
69+
test.equal(typeof "asdf".repeat, "function");
70+
test.equal(typeof "asdf".trim, "function");
71+
});
72+
73+
Tinytest.add("core-js - Symbol", function (test) {
74+
test.equal(typeof Symbol, "function");
75+
test.equal(
76+
typeof Array.prototype[Symbol.iterator],
77+
"function"
78+
);
79+
});
80+
81+
Tinytest.add("core-js - Function", function (test) {
82+
test.equal(
83+
typeof Function.prototype[Symbol.hasInstance],
84+
"function"
85+
);
86+
87+
function Constructor() {};
88+
test.equal(Constructor[Symbol.hasInstance](new Constructor), true);
89+
test.equal(Constructor[Symbol.hasInstance]({}), false);
90+
});
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var runtime = Npm.require("meteor-ecmascript-runtime");
2+
3+
Symbol = runtime.Symbol;
4+
Map = runtime.Map;
5+
Set = runtime.Set;

packages/ecmascript/package.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Package.onUse(function (api) {
1616
api.use('babel-compiler');
1717

1818
api.imply('babel-runtime');
19+
api.imply('ecmascript-runtime');
1920
api.imply('promise');
20-
api.imply('ecmascript-collections');
2121

2222
api.addFiles("ecmascript.js", "server");
2323
api.export("ECMAScript");

0 commit comments

Comments
 (0)