From 46af4afe0cfd3afddfe204913b5012be7369870f Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 25 Aug 2011 12:51:03 +0200 Subject: Don't enumerate Function.prototype.{connect,disconnect} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QML/JS adds connect and disconnect methods to the standard Function.prototype object. Follow the convention of ECMA-262: Function properties should be non-enumerable. In particular, we don't want such built-in properties to show up in user code "for-in" statements. Task-number: QTBUG-21120 Change-Id: I416106badf35daddf32e16f757d37b2b09e58310 Reviewed-on: http://codereview.qt.nokia.com/3587 Reviewed-by: Qt Sanity Bot Reviewed-by: Jędrzej Nowacki --- src/declarative/qml/v8/qv8qobjectwrapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/declarative/qml/v8/qv8qobjectwrapper.cpp b/src/declarative/qml/v8/qv8qobjectwrapper.cpp index c7ed0116e1..f59e995e2d 100644 --- a/src/declarative/qml/v8/qv8qobjectwrapper.cpp +++ b/src/declarative/qml/v8/qv8qobjectwrapper.cpp @@ -280,8 +280,8 @@ void QV8QObjectWrapper::init(QV8Engine *engine) { v8::Local prototype = engine->global()->Get(v8::String::New("Function"))->ToObject()->Get(v8::String::New("prototype"))->ToObject(); - prototype->Set(v8::String::New("connect"), V8FUNCTION(Connect, engine)); - prototype->Set(v8::String::New("disconnect"), V8FUNCTION(Disconnect, engine)); + prototype->Set(v8::String::New("connect"), V8FUNCTION(Connect, engine), v8::DontEnum); + prototype->Set(v8::String::New("disconnect"), V8FUNCTION(Disconnect, engine), v8::DontEnum); } } -- cgit v1.2.3