I am getting following error on my IE 8 page (The page is running fine in other browsers).
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3)
Timestamp: Wed, 10 Sep 2014 06:48:45 UTC
Message: Object doesn't support this property or method
Line: 70532
Char: 5
Code: 0
When I checked the line 70532 in the file mentioned, i saw this code:
if (!Object.create && !Object.create(null).hasOwnProperty) {
throw new Error("This browser does not support Object.create(null), please polyfil with es5-sham: http://git.io/yBU2rg");
}
What does it meant by Please polyfil with es5-sham:
Please polyfil with es5-sham: http://git.io/yBU2rg
How can I fix this error.
Object.create
is not supported in IE8, therefore your framework is asking you to "polyfil" it, which means you need to implement something which should have been supported natively, but for some reason, this particular environment doesn't know about it.
It means, if you want to use Object.create
you have to implement it yourself. Fortunatelly, you don't have to do much, the url ( https://github.com/es-shims/es5-shim/blob/master/es5-sham.js) points to a file which contains the neccesary polyfills.
Just run that script before your framework script does.
update:
This line seems broken to me: !Object.create && !Object.create(null).hasOwnProperty
.
If Object.create
is not there, calling it like Object.create(null)
should throw an error, but I think it should be something like 'undefined is not a function'.