diff options
| author | Robin Burchell <robin.burchell@crimson.no> | 2017-02-03 08:28:20 +0100 |
|---|---|---|
| committer | Robin Burchell <robin.burchell@crimson.no> | 2017-02-03 15:10:36 +0000 |
| commit | fb787067ee05dcf50f53ed01797eaaad246e913e (patch) | |
| tree | 0f4106785f6f08eea51a6b7395ac6ea5369dcf02 /src/qml/jsruntime/qv4objectproto.cpp | |
| parent | 6653fdb6bfb538b601685966ad96e055bafbdbcf (diff) | |
ObjectPrototype: Object.freeze() no longer sets TypeError for a non-Object
This is a behavior change in ES6. Refer to:
19.1.2.5 (Object.freeze)
Annex E (Additions and Changes That Introduce Incompatibilities with
Prior Editions)
ES6 tests test/built-ins/Object/freeze before:
=== Summary ===
- Ran 92 tests
- Passed 66 tests (71.7%)
- Failed 26 tests (28.3%)
after:
=== Summary ===
- Ran 92 tests
- Passed 76 tests (82.6%)
- Failed 16 tests (17.4%)
Change-Id: Ia28da790b510580248056e0df7b305a5edc470dd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4objectproto.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4objectproto.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index 97dbe24339..dc8f66f378 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -265,8 +265,11 @@ void ObjectPrototype::method_seal(const BuiltinFunction *, Scope &scope, CallDat void ObjectPrototype::method_freeze(const BuiltinFunction *, Scope &scope, CallData *callData) { ScopedObject o(scope, callData->argument(0)); - if (!o) - THROW_TYPE_ERROR(); + if (!o) { + // 19.1.2.5, 1 + scope.result = callData->argument(0); + return; + } if (ArgumentsObject::isNonStrictArgumentsObject(o)) static_cast<ArgumentsObject *>(o.getPointer())->fullyCreate(); |
