8135178: importPackage not working even with load "Mozilla compatibility script"

Reviewed-by: hannesw
This commit is contained in:
Athijegannathan Sundararajan 2017-11-27 17:04:33 +05:30
parent e196ae9be6
commit 589129ece4
2 changed files with 49 additions and 1 deletions

View file

@ -45,7 +45,7 @@ Object.defineProperty(this, "JavaAdapter", {
// importPackage
// avoid unnecessary chaining of __noSuchProperty__ again
// in case user loads this script more than once.
if (typeof importPackage == 'undefined') {
if (typeof importPackage == 'undefined' || !(importPackage instanceof Function)) {
Object.defineProperty(this, "importPackage", {
configurable: true, enumerable: false, writable: true,