New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE9 errors due to EcmaScript 5 incompatble getters/setters #12

Closed
GoogleCodeExporter opened this Issue Aug 24, 2015 · 11 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter

GoogleCodeExporter commented Aug 24, 2015

Errors appear in IE9:

  SCRIPT438: Object doesn't support this property or method  Box2dWeb-2.1a.2.js.js, line 2036 character 4
  SCRIPT5007: 'undefined' is null or not an object  Box2dWeb-2.1a.2.js.js, line 346 character 7

Only tested on Win 7 64bit - IE9 Beta 9.0.7930

Any ideas?

Original issue reported on code.google.com by smartm...@gmail.com on 15 Jan 2011 at 12:41

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Aug 24, 2015

I've got this to work in IE by changeing the __defineGetter__ and defineSetter 
methods to Object.defineProperty

ie:
Object.defineProperty(
    b2ContactID.prototype,
    'key',
        {
            get:function(){
            return this._key;
        },
        set:function(value){
            if (value === undefined) value = 0;
            this._key = value;
            this.features._referenceEdge = this._key & 0x000000ff;
            this.features._incidentEdge = ((this._key & 0x0000ff00) >> 8) & 0x000000ff;
            this.features._incidentVertex = ((this._key & 0x00ff0000) >> 16) & 0x000000ff;
            this.features._flip = ((this._key & 0xff000000) >> 24) & 0x000000ff;
        }
    }
);
/*
   b2ContactID.prototype.__defineGetter__('key', function () {
      return this._key;
   });
   b2ContactID.prototype.__defineSetter__('key', function (value) {
      if (value === undefined) value = 0;
      this._key = value;
      this.features._referenceEdge = this._key & 0x000000ff;
      this.features._incidentEdge = ((this._key & 0x0000ff00) >> 8) & 0x000000ff;
      this.features._incidentVertex = ((this._key & 0x00ff0000) >> 16) & 0x000000ff;
      this.features._flip = ((this._key & 0xff000000) >> 24) & 0x000000ff;
   });*/

This will only work in ie9 and will throw errors in other browsers so I'm going 
to do something like:


if (Modernizr.canvas){
     if ($.browser.msie){
    document.write(unescape('%3Cscript src="box2web-normal.js"%3E%3C/script%3E'))   
     } else {
    document.write(unescape('%3Cscript src="box2web-ie9.js"%3E%3C/script%3E'))  
     }
}

Original comment by smartm...@gmail.com on 16 Jan 2011 at 10:24

Attachments:

GoogleCodeExporter commented Aug 24, 2015

I've got this to work in IE by changeing the __defineGetter__ and defineSetter 
methods to Object.defineProperty

ie:
Object.defineProperty(
    b2ContactID.prototype,
    'key',
        {
            get:function(){
            return this._key;
        },
        set:function(value){
            if (value === undefined) value = 0;
            this._key = value;
            this.features._referenceEdge = this._key & 0x000000ff;
            this.features._incidentEdge = ((this._key & 0x0000ff00) >> 8) & 0x000000ff;
            this.features._incidentVertex = ((this._key & 0x00ff0000) >> 16) & 0x000000ff;
            this.features._flip = ((this._key & 0xff000000) >> 24) & 0x000000ff;
        }
    }
);
/*
   b2ContactID.prototype.__defineGetter__('key', function () {
      return this._key;
   });
   b2ContactID.prototype.__defineSetter__('key', function (value) {
      if (value === undefined) value = 0;
      this._key = value;
      this.features._referenceEdge = this._key & 0x000000ff;
      this.features._incidentEdge = ((this._key & 0x0000ff00) >> 8) & 0x000000ff;
      this.features._incidentVertex = ((this._key & 0x00ff0000) >> 16) & 0x000000ff;
      this.features._flip = ((this._key & 0xff000000) >> 24) & 0x000000ff;
   });*/

This will only work in ie9 and will throw errors in other browsers so I'm going 
to do something like:


if (Modernizr.canvas){
     if ($.browser.msie){
    document.write(unescape('%3Cscript src="box2web-normal.js"%3E%3C/script%3E'))   
     } else {
    document.write(unescape('%3Cscript src="box2web-ie9.js"%3E%3C/script%3E'))  
     }
}

Original comment by smartm...@gmail.com on 16 Jan 2011 at 10:24

Attachments:

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Aug 24, 2015

Sorry that if statement was the wrong way round:

if (Modernizr.canvas){
     if ($.browser.msie){
    document.write(unescape('%3Cscript src="box2web-ie9.js"%3E%3C/script%3E'))  
     } else {
    document.write(unescape('%3Cscript src="box2web-normal.js"%3E%3C/script%3E'))   
     }
}

Original comment by smartm...@gmail.com on 16 Jan 2011 at 10:25

GoogleCodeExporter commented Aug 24, 2015

Sorry that if statement was the wrong way round:

if (Modernizr.canvas){
     if ($.browser.msie){
    document.write(unescape('%3Cscript src="box2web-ie9.js"%3E%3C/script%3E'))  
     } else {
    document.write(unescape('%3Cscript src="box2web-normal.js"%3E%3C/script%3E'))   
     }
}

Original comment by smartm...@gmail.com on 16 Jan 2011 at 10:25

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Aug 24, 2015

Actually, IE isn't supported yet. But if this works, I'll add a wiki entry 
about this workaround.

Original comment by Uli.He...@googlemail.com on 17 Jan 2011 at 9:52

GoogleCodeExporter commented Aug 24, 2015

Actually, IE isn't supported yet. But if this works, I'll add a wiki entry 
about this workaround.

Original comment by Uli.He...@googlemail.com on 17 Jan 2011 at 9:52

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Aug 24, 2015

[deleted comment]

GoogleCodeExporter commented Aug 24, 2015

[deleted comment]
@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Aug 24, 2015

Sorry not an issue as such, just didn't know where to post it. Works really 
well in IE9 with GPU support.

Original comment by smartm...@gmail.com on 17 Jan 2011 at 10:24

GoogleCodeExporter commented Aug 24, 2015

Sorry not an issue as such, just didn't know where to post it. Works really 
well in IE9 with GPU support.

Original comment by smartm...@gmail.com on 17 Jan 2011 at 10:24

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Aug 24, 2015

That's good news anyways, because I thought that there are other problems, as 
well. But I didn't spend too much effort on testing it, since IE9 is still in 
beta-state.

Original comment by Uli.He...@googlemail.com on 18 Jan 2011 at 1:08

GoogleCodeExporter commented Aug 24, 2015

That's good news anyways, because I thought that there are other problems, as 
well. But I didn't spend too much effort on testing it, since IE9 is still in 
beta-state.

Original comment by Uli.He...@googlemail.com on 18 Jan 2011 at 1:08

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Aug 24, 2015

Well, __define(G/S)etter__ was easier to implement in the converter. The old 
version loops through an array of class members, which requires that setter and 
getter can be defined independently.
However, the new version (work in progress) uses another concept: The 
parser-output is being processed by javscript-object queries using JsonPath.

If the properties are the only problem then I think it is worth the effort.

I'll try to rename the ticket. The current title isn't meaningful enough.

Original comment by Uli.He...@googlemail.com on 18 Jan 2011 at 1:47

  • Changed title: IE9 errors due to EcmaScript 5 incompatble getters/setters
  • Changed state: Accepted

GoogleCodeExporter commented Aug 24, 2015

Well, __define(G/S)etter__ was easier to implement in the converter. The old 
version loops through an array of class members, which requires that setter and 
getter can be defined independently.
However, the new version (work in progress) uses another concept: The 
parser-output is being processed by javscript-object queries using JsonPath.

If the properties are the only problem then I think it is worth the effort.

I'll try to rename the ticket. The current title isn't meaningful enough.

Original comment by Uli.He...@googlemail.com on 18 Jan 2011 at 1:47

  • Changed title: IE9 errors due to EcmaScript 5 incompatble getters/setters
  • Changed state: Accepted
@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Aug 24, 2015

This issue was closed by revision r21.

Original comment by Uli.He...@googlemail.com on 23 Jan 2011 at 4:36

  • Changed state: Fixed

GoogleCodeExporter commented Aug 24, 2015

This issue was closed by revision r21.

Original comment by Uli.He...@googlemail.com on 23 Jan 2011 at 4:36

  • Changed state: Fixed
@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Aug 24, 2015

note that IE9 still doesn't work properly, i.e. it behaves differently compared 
to other browsers. This should be reported in a new ticket.

Original comment by Uli.He...@googlemail.com on 23 Jan 2011 at 4:40

GoogleCodeExporter commented Aug 24, 2015

note that IE9 still doesn't work properly, i.e. it behaves differently compared 
to other browsers. This should be reported in a new ticket.

Original comment by Uli.He...@googlemail.com on 23 Jan 2011 at 4:40

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Aug 24, 2015

This does not appear to have been fixed, until an official fix is provided, I 
have replaced the properties in the current version (as of 18/03/11) with 
getter/setter pairs, seems to be working in the latest release of IE9.

This should be a top priority issue! IE still holds a large user base

Original comment by weesal...@hotmail.com on 18 Mar 2011 at 12:33

Attachments:

GoogleCodeExporter commented Aug 24, 2015

This does not appear to have been fixed, until an official fix is provided, I 
have replaced the properties in the current version (as of 18/03/11) with 
getter/setter pairs, seems to be working in the latest release of IE9.

This should be a top priority issue! IE still holds a large user base

Original comment by weesal...@hotmail.com on 18 Mar 2011 at 12:33

Attachments:

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Aug 24, 2015

This was fixed on Jan 23 by revision r21. Due to strange IE9 behavior and few 
feedback I didn't provide a new official release (in the downloads section).

Original comment by Uli.He...@googlemail.com on 18 Mar 2011 at 12:49

GoogleCodeExporter commented Aug 24, 2015

This was fixed on Jan 23 by revision r21. Due to strange IE9 behavior and few 
feedback I didn't provide a new official release (in the downloads section).

Original comment by Uli.He...@googlemail.com on 18 Mar 2011 at 12:49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment