summaryrefslogtreecommitdiffstats
path: root/js/src/jsobj.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsobj.cpp')
-rw-r--r--js/src/jsobj.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp
index a39a4b0a0..2e36dcf9f 100644
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -2936,6 +2936,11 @@ DefineFunctionFromSpec(JSContext* cx, HandleObject obj, const JSFunctionSpec* fs
if (!PropertySpecNameToId(cx, fs->name, &id))
return false;
+ if (StandardProtoKeyOrNull(obj) == JSProto_Array && id == NameToId(cx->names().values)) {
+ if (!cx->options().arrayProtoValues())
+ return true;
+ }
+
JSFunction* fun = NewFunctionFromSpec(cx, fs, id);
if (!fun)
return false;