mirror of
https://github.com/dart-lang/sdk
synced 2024-09-23 00:23:57 +00:00
Guard against null prototype properties
Review URL: https://codereview.chromium.org//37853003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29122 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
1787f36d42
commit
3c4f43af68
|
@ -327,10 +327,12 @@ void initNativeDispatch() {
|
|||
if (JS('bool', 'typeof (#[#]) == "function"', context, tag)) {
|
||||
var constructor = JS('', '#[#]', context, tag);
|
||||
var proto = JS('', '#.prototype', constructor);
|
||||
var interceptorClass = JS('', '#[#]', map, tag);
|
||||
var record = makeDefaultDispatchRecord(tag, interceptorClass, proto);
|
||||
if (record != null) {
|
||||
setDispatchProperty(proto, record);
|
||||
if (proto != null) { // E.g. window.mozRTCIceCandidate.prototype
|
||||
var interceptorClass = JS('', '#[#]', map, tag);
|
||||
var record = makeDefaultDispatchRecord(tag, interceptorClass, proto);
|
||||
if (record != null) {
|
||||
setDispatchProperty(proto, record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue