Skip to content

Chakra should throw TypeError when try to set property of an object which has only a getter #5033

Open
@igor-simoes

Description

@igor-simoes

Hi everyone,
I found an inconsistency when we try to set a getter-only property of an object.

OS: Ubuntu 16.04 x86
Chakra: 1.9

Step to reproduce:

try{
    var a = {get "0"() {return 1;}, length: 1};
    [].fill.call(a, 2);
    throw new Error("should not reach this point")
}
catch(error){
    if (!(error instanceof TypeError)) throw new Error('Should throw TypeError')
}

Actual results:
Error: Should throw TypeError

Expected results:
pass without errors

V8, SpiderMonkey and JavascriptCore throws a TypeError when attempted to assign to readonly property.

cinfuzz

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions