Version 2.2.22
Added ES5 Object.isExtensible and Object.preventExtensions.
Enabled building V8 as a DLL.
Fixed a bug in date code where -0 was not interpreted as 0 (issue 736).
Performance improvements on all platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@5017 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/v8natives.js b/src/v8natives.js
index 24d5e7c..487faab 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -745,6 +745,27 @@
}
+// ES5 section 15.2.3.10
+function ObjectPreventExtension(obj) {
+ if ((!IS_SPEC_OBJECT_OR_NULL(obj) || IS_NULL_OR_UNDEFINED(obj)) &&
+ !IS_UNDETECTABLE(obj)) {
+ throw MakeTypeError("obj_ctor_property_non_object", ["preventExtension"]);
+ }
+ %PreventExtensions(obj);
+ return obj;
+}
+
+
+// ES5 section 15.2.3.13
+function ObjectIsExtensible(obj) {
+ if ((!IS_SPEC_OBJECT_OR_NULL(obj) || IS_NULL_OR_UNDEFINED(obj)) &&
+ !IS_UNDETECTABLE(obj)) {
+ throw MakeTypeError("obj_ctor_property_non_object", ["preventExtension"]);
+ }
+ return %IsExtensible(obj);
+}
+
+
%SetCode($Object, function(x) {
if (%_IsConstructCall()) {
if (x == null) return this;
@@ -780,7 +801,9 @@
"defineProperties", ObjectDefineProperties,
"getPrototypeOf", ObjectGetPrototypeOf,
"getOwnPropertyDescriptor", ObjectGetOwnPropertyDescriptor,
- "getOwnPropertyNames", ObjectGetOwnPropertyNames
+ "getOwnPropertyNames", ObjectGetOwnPropertyNames,
+ "isExtensible", ObjectIsExtensible,
+ "preventExtensions", ObjectPreventExtension
));
}