Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uglify #790

Merged
merged 2 commits into from
May 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 9 additions & 6 deletions js/core/pubsubhub.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ define([], function() {
.slice(1);
// we take a copy, because subscribers can unsubscribe themselves
// leading to race conditions
for (var cb of Array.from(subscriptions.get(topic))) {
cb.apply(null, restParams);
}
Array
.from(subscriptions.get(topic))
.forEach(function(cb) {
cb.apply(null, restParams);
});

// If this is an iframe, postMessage parent (used in testing).
if (window.parent === window.self) {
return;
Expand Down Expand Up @@ -57,17 +60,17 @@ define([], function() {
}
};

PubSubHub.sub("error", function(err){
PubSubHub.sub("error", function(err) {
console.error(err.stack || err);
});

PubSubHub.sub("warn", function(str){
PubSubHub.sub("warn", function(str) {
console.warn(str);
});

// Add deprecation warning
Object.defineProperty(window, "respecEvents", {
get: function(){
get: function() {
var warning = "window.respecEvents() is deprecated. Use 'require(\"core\\pubsubhub\", aFunction)' instead.";
PubSubHub.pub("warn", warning);
return PubSubHub;
Expand Down
3 changes: 3 additions & 0 deletions tools/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ function replaceMapFilename(respecJs, outPath){
const currentMapFilename = respecJs.match(findSourceMapName)[1];
source = respecJs.replace(currentMapFilename, newMapFilename);
} else {
const warn = " ⚠️ The source map is missing. Something has probably gone wrong.";
console.warn(warn);
source = respecJs;
}
const mapPath = pth.resolve(outPath, `../${newMapFilename}`);
Expand Down Expand Up @@ -105,6 +107,7 @@ var Builder = {
"webidl2": "../node_modules/webidl2/lib/webidl2",
},
name: "profile-w3c-common",
logLevel: 2, // Show uglify warnings and errors.
deps: [
"core/jquery-enhanced",
"jquery",
Expand Down