diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2011-08-25 12:51:03 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-26 07:54:35 +0200 |
commit | 46af4afe0cfd3afddfe204913b5012be7369870f (patch) | |
tree | 7bdc8422d33621127517109bbb66ff0f9536ee84 /src | |
parent | 6dd1ab81e1c7943053feea321b6f7774b688ee5d (diff) |
Don't enumerate Function.prototype.{connect,disconnect}
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 <qt_sanity_bot@ovi.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/v8/qv8qobjectwrapper.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<v8::Object> 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); } } |