Skip to content

Commit

Permalink
Improve Map/Set TypeError messages when called as a function.
Browse files Browse the repository at this point in the history
Fixes #321
  • Loading branch information
ljharb committed Feb 25, 2015
1 parent 25f2e3e commit 984441d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions es6-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -2037,7 +2037,7 @@
function Map(iterable) {
var map = this;
if (!ES.TypeIsObject(map)) {
throw new TypeError('Map does not accept arguments when called as a function');
throw new TypeError("Constructor Map requires 'new'");
}
map = emulateES6construct(map);
if (!map._es6map) {
Expand Down Expand Up @@ -2227,7 +2227,7 @@
var SetShim = function Set(iterable) {
var set = this;
if (!ES.TypeIsObject(set)) {
throw new TypeError('Set does not accept arguments when called as a function');
throw new TypeError("Constructor Set requires 'new'");
}
set = emulateES6construct(set);
if (!set._es6set) {
Expand Down

0 comments on commit 984441d

Please sign in to comment.