diff --git a/caps/nsScriptSecurityManager.cpp b/caps/nsScriptSecurityManager.cpp index aeae490a9..9201db1c3 100644 --- a/caps/nsScriptSecurityManager.cpp +++ b/caps/nsScriptSecurityManager.cpp @@ -693,18 +693,35 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal, // Scripts that somehow hit hard limits should go in here if (!mIsTenFourFoxTroublesomeJsAllowed && (targetScheme.EqualsLiteral("http") || targetScheme.EqualsLiteral("https"))) { - nsAutoCString hostname; - if (MOZ_LIKELY(NS_SUCCEEDED(targetBaseURI->GetHost(hostname)))) { + nsAutoCString hostname, url; + if (MOZ_LIKELY(NS_SUCCEEDED(targetBaseURI->GetHost(hostname)) && + NS_SUCCEEDED(targetBaseURI->GetAsciiSpec(url)))) { ToLowerCase(hostname); #define BLOC(q) hostname.EqualsLiteral(q) +#define BLOCU(q) url.EqualsLiteral(q) if (0 || #ifdef __ppc__ - /* No sites in blocklist currently */ +/* // Wallpaper issue 621 +BLOCU("https://static-exp1.licdn.com/sc/h/br/a9r8138k1irfu2dd3nc8lsbix") || +BLOCU("https://static-exp1.licdn.com/sc/h/br/7lllmhir13652hrt9onk67idy") || +BLOCU("https://static-exp1.licdn.com/sc/h/br/ykrp2se5j5958492sngjpz25") || +BLOCU("https://static-exp1.licdn.com/sc/h/br/44lpm3xommt4uaobb0rsjjk0w") || +BLOCU("https://static-exp1.licdn.com/sc/h/br/vlr4p5f5ashr0bmvreet5pvx") || +BLOCU("https://static-exp1.licdn.com/sc/h/br/alufmlg2at1ul00ieyk97ixid") || +BLOCU("https://static-exp1.licdn.com/sc/h/br/b24igfxqe5873icdp0jjivlxm") || +BLOCU("https://static-exp1.licdn.com/sc/h/br/eebyccxtdylbl8mwqaz4jbzuo") || +BLOCU("https://static-exp1.licdn.com/sc/h/br/157ealvvl2h15m378fl1ql2ko") || +BLOCU("https://static-exp1.licdn.com/sc/h/br/1xfk2iz9afmrcwfdn8fqqu87r") || +BLOCU("https://static-exp1.licdn.com/sc/h/br/238gxgltll8zj8cws2vtlows2") || +BLOCU("https://static-exp1.licdn.com/sc/h/br/y57044rjondvhcx610qaq6ok") || +*/ +BLOCU("https://static-exp1.licdn.com/sc/h/br/2smvxovs24agey0kv9qjzih51") || #endif // __ppc__ 0) { #undef BLOC +#undef BLOCU #ifndef DEBUG if (mIsTenFourFoxTroublesomeJsLoggingEnabled) diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 5501d97ef..dec1b4a67 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -1914,9 +1914,18 @@ BytecodeEmitter::bindNameToSlotHelper(ParseNode* pn) * bloat where a single live function keeps its whole global script * alive.), ScopeCoordinateToTypeSet is not able to find the var/let's * associated TypeSet. + * + * Note the following does not prevent us from optimizing block scopes at + * global level, e.g., + * + * { let x; function f() { x = 42; } } */ - if (bceOfDef != this && bceOfDef->sc->isGlobalContext()) + if (dn->kind() == Definition::LET || dn->kind() == Definition::CONSTANT) { + if (IsStaticGlobalLexicalScope(blockScopeOfDef(dn))) + return true; + } else if (bceOfDef != this && bceOfDef->sc->isGlobalContext()) { return true; + } if (!pn->pn_scopecoord.set(parser->tokenStream, hops, slot)) return false;