Start a new topic

mscorlib.js error on Mac Safari

When i run my app in safari on mac. I get the following error on load...


is calling my Program.Main(); function - Notes: everything works fine on chome and firefox on mac... Works in IE and Firefox and Chrome on windows.



Anyways here is error:


[Error] TypeError: Attempted to assign to readonly property.

 declare (mscorlib.js, line 103)

 AjaxGateway_Duo (AjaxGateway.Duo.js, line 706)

 global code (AjaxGateway.Duo.js, line 4214)


Update: seems to be a problem in a part of the app that subclass System.Xml.XmlDocument.


This is the offending Javascript produced by compiler that is error on declare from mscorlib.js called from AjaxGateway.Duo.js, line 706:


System.Xml.AjaxXmlDocument = $d.declare("System.Xml.AjaxXmlDocument", XMLDocument, 0, $asm, function($t, $p) {

        $t.$typeInfo = function(t, p) {

            return [1, null, null, [["ctor", t.ctor, 6]]];

        };

        $t.ctor = function AjaxXmlDocument() {

            $t.$baseType.ctor.call(this);

        };

        $t.ctor.prototype = $p;

    });


IT does not like my System.Xml.XmlDocument subclass in safari on a mac.

From your stack, this is line #103 that causes the error in Safari on Mac with XMLDocument:

 

typeFunction.prototype.constructor = typeFunction;

 

The problem is that XMLDocument in Safari is object and not function, thus can't be inherited from.

You can check:

typeof XMLDocument is "function" in Chrome but "object" in Safari (PhantomJS too).


The only solution is not to override from this class.

Login or Signup to post a comment