Menu

#1897 TypeError: Cannot modify readonly property: constructor.

Latest SVN
accepted
nobody
None
1
2018-10-19
2017-06-30
RBRi
No

This code fails

    public static void main(String[] args) throws Exception {
        final WebClient webClient = new WebClient(BrowserVersion.CHROME);

        final HtmlPage webPage = (HtmlPage) webClient.getPage("https://www.marinetraffic.com/");
        System.out.println(webPage.asXml());

    }

Discussion

  • RBRi

    RBRi - 2017-06-30
    • status: open --> accepted
    • Group: 2.27 --> Latest SVN
     
  • RBRi

    RBRi - 2017-06-30

    Had done a lot of debugging but was not able to fix this so far.
    What i found:

    • this is new with our current core-js snapshot / does not occur with 2.27
    • the exception is thrown from com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.initialize(WebWindow); the problematic calls are ((FunctionObject) function).addAsConstructor(window, prototype);
    • the exeption is not thrown when calling the init for the first window; the init is called a second time because the code creates an iFrame and init is called for this iframe
    • i was not able to build a minimal test case
    • the problem ocures when init reaches the classes Option, MutationObserver, webkitURL, TransitionEvent and WebKitAnimationEvent
     

    Last edit: RBRi 2017-06-30
  • RBRi

    RBRi - 2017-07-21

    Minimal progress - the reason seems to be because the script switches to scrict mode.

     
  • RBRi

    RBRi - 2017-07-22
    • assigned_to: RBRi
     
  • RBRi

    RBRi - 2017-07-22

    I think i have an idea now what is going on here

     
  • RBRi

    RBRi - 2017-07-22
    • assigned_to: RBRi --> nobody
     
  • RBRi

    RBRi - 2017-07-22

    Test case added
    com.gargoylesoftware.htmlunit.html.HtmlInlineFrame2Test.createIframeFromStrictFunction()

     

    Last edit: RBRi 2017-10-15
  • Michael Anderson

    Any update on this?

     
  • Stas Agarkov

    Stas Agarkov - 2018-09-21

    The error is reproduced on the site https://beru.ru/

     
  • PRA

    PRA - 2018-10-19
     

Log in to post a comment.

Auth0 Logo