From a973e3a16ecbcbb9acda1dec9fd2b0065b8b4294 Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Tue, 22 Jul 2014 09:44:56 +0000 Subject: [PATCH] Update test and rebaseline BUG= R=ishell@chromium.org Review URL: https://codereview.chromium.org/408183002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22520 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/objects.cc | 6 ++++-- ...ive-property-access-edge-cases-expected.txt | 18 +++++++++--------- .../fast/js/read-modify-eval-expected.txt | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/objects.cc b/src/objects.cc index 9939927222..0f9ea21d37 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -3107,8 +3107,10 @@ MaybeHandle Object::AddDataProperty(LookupIterator* it, StrictMode strict_mode, StoreFromKeyed store_mode) { ASSERT(!it->GetReceiver()->IsJSProxy()); - // Transitions to data properties of value wrappers are not observable. - if (!it->GetReceiver()->IsJSObject()) return value; + if (!it->GetReceiver()->IsJSObject()) { + // TODO(verwaest): Throw a TypeError with a more specific message. + return WriteToReadOnlyProperty(it, value, strict_mode); + } Handle receiver = Handle::cast(it->GetReceiver()); // If the receiver is a JSGlobalProxy, store on the prototype (JSGlobalObject) diff --git a/test/webkit/fast/js/primitive-property-access-edge-cases-expected.txt b/test/webkit/fast/js/primitive-property-access-edge-cases-expected.txt index f07d273f33..cc273dfba0 100644 --- a/test/webkit/fast/js/primitive-property-access-edge-cases-expected.txt +++ b/test/webkit/fast/js/primitive-property-access-edge-cases-expected.txt @@ -29,15 +29,15 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE PASS checkGet(1, Number) is true PASS checkGet('hello', String) is true PASS checkGet(true, Boolean) is true -FAIL checkSet(1, Number) should be true. Was false. -FAIL checkSet('hello', String) should be true. Was false. -FAIL checkSet(true, Boolean) should be true. Was false. +PASS checkSet(1, Number) is true +PASS checkSet('hello', String) is true +PASS checkSet(true, Boolean) is true PASS checkGetStrict(1, Number) is true PASS checkGetStrict('hello', String) is true PASS checkGetStrict(true, Boolean) is true -FAIL checkSetStrict(1, Number) should be true. Was false. -FAIL checkSetStrict('hello', String) should be true. Was false. -FAIL checkSetStrict(true, Boolean) should be true. Was false. +PASS checkSetStrict(1, Number) is true +PASS checkSetStrict('hello', String) is true +PASS checkSetStrict(true, Boolean) is true PASS checkRead(1, Number) is true PASS checkRead('hello', String) is true PASS checkRead(true, Boolean) is true @@ -47,9 +47,9 @@ PASS checkWrite(true, Boolean) is true PASS checkReadStrict(1, Number) is true PASS checkReadStrict('hello', String) is true PASS checkReadStrict(true, Boolean) is true -FAIL checkWriteStrict(1, Number) should throw an exception. Was true. -FAIL checkWriteStrict('hello', String) should throw an exception. Was true. -FAIL checkWriteStrict(true, Boolean) should throw an exception. Was true. +PASS checkWriteStrict(1, Number) threw exception TypeError: Cannot assign to read only property 'foo' of 1. +PASS checkWriteStrict('hello', String) threw exception TypeError: Cannot assign to read only property 'foo' of hello. +PASS checkWriteStrict(true, Boolean) threw exception TypeError: Cannot assign to read only property 'foo' of true. PASS checkNumericGet(1, Number) is true PASS checkNumericGet('hello', String) is true PASS checkNumericGet(true, Boolean) is true diff --git a/test/webkit/fast/js/read-modify-eval-expected.txt b/test/webkit/fast/js/read-modify-eval-expected.txt index 4a16d0a7a2..b375b37806 100644 --- a/test/webkit/fast/js/read-modify-eval-expected.txt +++ b/test/webkit/fast/js/read-modify-eval-expected.txt @@ -42,7 +42,7 @@ PASS preDecTest(); is true PASS postIncTest(); is true PASS postDecTest(); is true PASS primitiveThisTest.call(1); is true -FAIL strictThisTest.call(1); should throw an exception. Was true. +PASS strictThisTest.call(1); threw exception TypeError: Cannot assign to read only property 'value' of 1. PASS successfullyParsed is true TEST COMPLETE