Ad

Is A Feature Not Fully Implemented If A Browser Does Not Have `ToStringTag` For The Feature?

- 1 answer

I wonder we can say that a feature is not fully implemented when a browser does not have ToStringTag for the feature. For example, IE 11 supports Map, Set, and WeakMap but it does not have a ToStringTag for them. Thus, some unit tests failed in Lodash.

According to Mozilla documentation, there are three main causes of cross-browser issues: 1) "sometimes browsers have bugs, or implement features differently." 2) "some browsers may have different levels of support for technology features to others." and 3) "some devices may have constraints that cause a web site to run slowly, or display badly.".

I am analyzing causes of some cross-browser failures for a research paper. I think the example is related to the second cause. What is your opinion?

Ad

Answer

Since the specification that added Map, Set, and WeakMap defined that they would have @@toStringTag and that Object.prototype.toString would use it, then yes, if IE11 has (for instance) Map but Object.prototype.toString.call(new Map) doesn't return [object Map] as it's specified that it should, Map isn't fully implemented, it's partially implemented. And yes, that seems like a match for your #2.

Ad
source: stackoverflow.com
Ad