Version 3.20.12
Removed buggy ToNumber truncation (partial fix for issue 2813)
Calling Map etc without new should throw TypeError (issue 2819)
Fixed a crash for large code objects on ARM (Chromium issue 2736)
Fixed stale unhandlified value in JSObject::SetPropertyForResult. (Chromium issue 265894)
Added new Harmony methods to String.prototype object. (issue 2796,v8:2797,v8:2798,v8:2799)
Performance and stability improvements on all platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@16010 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/collection.js b/src/collection.js
index 63ddbbb..01537e8 100644
--- a/src/collection.js
+++ b/src/collection.js
@@ -47,7 +47,7 @@
if (%_IsConstructCall()) {
%SetInitialize(this);
} else {
- return new $Set();
+ throw MakeTypeError('constructor_not_function', ['Set']);
}
}
@@ -141,7 +141,7 @@
if (%_IsConstructCall()) {
%MapInitialize(this);
} else {
- return new $Map();
+ throw MakeTypeError('constructor_not_function', ['Map']);
}
}
@@ -243,7 +243,7 @@
if (%_IsConstructCall()) {
%WeakCollectionInitialize(this);
} else {
- return new $WeakMap();
+ throw MakeTypeError('constructor_not_function', ['WeakMap']);
}
}
@@ -335,7 +335,7 @@
if (%_IsConstructCall()) {
%WeakCollectionInitialize(this);
} else {
- return new $WeakSet();
+ throw MakeTypeError('constructor_not_function', ['WeakSet']);
}
}