Bug 220842 - A question about global variables
Summary: A question about global variables
Status: RESOLVED DUPLICATE of bug 203456
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: PC Linux
: P2 Normal
Assignee: Alexey Shvayka
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-21 23:20 PST by NWU_NISL
Modified: 2021-02-02 10:45 PST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description NWU_NISL 2021-01-21 23:20:45 PST
#version: dbae081(https://github.com/WebKit/WebKit-http/commit/dbae081ad7e22d9ab61edf2f337f6c2bb593c7f8)

#Testcase:
var x = 4;
Object.defineProperty(this, 'x', {
    writable: false
});
x = 3;
print(x);
print(this.x);

#Command:
./webkit/WebKitBuild/Release/bin/jsc testcase.js

#Output:
3
4

#Expected output:
4
4

#Description:
When executing this test case, since x is not writable (in line 3), other engines (such as v8, SpiderMonkey, chakra, etc.) did not change the value of x, but JavascriptCore successfully changed the value of x to 3. Maybe this is a bug of JavascriptCore.
Comment 1 Radar WebKit Bug Importer 2021-01-27 16:54:51 PST
<rdar://problem/73686367>
Comment 2 Yusuke Suzuki 2021-02-01 02:42:51 PST
@Alexey maybe this is the same to https://bugs.webkit.org/show_bug.cgi?id=203456 ?
Comment 3 Alexey Shvayka 2021-02-02 07:39:27 PST
(In reply to Yusuke Suzuki from comment #2)
> @Alexey maybe this is the same to
> https://bugs.webkit.org/show_bug.cgi?id=203456 ?

Yeah, that's right, thanks.
I wish we could remove JSGlobalObject::defineOwnProperty() though...

*** This bug has been marked as a duplicate of bug 203456 ***
Comment 4 Yusuke Suzuki 2021-02-02 10:45:22 PST
(In reply to Alexey Shvayka from comment #3)
> (In reply to Yusuke Suzuki from comment #2)
> > @Alexey maybe this is the same to
> > https://bugs.webkit.org/show_bug.cgi?id=203456 ?
> 
> Yeah, that's right, thanks.
> I wish we could remove JSGlobalObject::defineOwnProperty() though...

Yeah :)

> 
> *** This bug has been marked as a duplicate of bug 203456 ***