Skip to content

Window's [[Get]] can fail an assert #4252

@bzbarsky

Description

@bzbarsky

Consider this testcase, where "win" is a cross-origin window with no subframes:

win[1000];

What happens? We land in https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-get and:

  1. W is the window, fine.
  2. IsPlatformObjectSameOrigin returns false.
  3. Call CrossOriginGet.

So that calls https://html.spec.whatwg.org/multipage/browsers.html#crossoriginget-(-o,-p,-receiver-) which does:

  1. Let desc be ? O.[[GetOwnProperty]](P).
  2. Assert: desc is not undefined.

OK, so what happened under [[GetOwnProperty]]? It called https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-getownproperty and did:

  1. W is the window.
  2. P is an array index property name.
    2.1 index is 1000.
    2.2 maxProperties is 0.
    2.3 value is undefined.
    2.4 maxProperties is not greater than 0.
    2.5 value is undefined, so return undefined.

So it sure looks to me like we would fail that "desc is not undefined" assert.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions