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 syntax errors #28165

Merged
merged 1 commit into from
Jul 25, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,10 @@ exports.get("/about", async function (req, res, next) {
try {
const successfulResult = await About.find({}).exec();
res.render("about_view", { title: "About", list: successfulResult });
}
catch (error) {
} catch (error) {
return next(error);
}
};
});
```

That's quite a lot of boilerplate code to add to every function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The following example collects event duration for all events corresponding to an

```js
// The key is the interaction ID.
let = eventLatencies = {};
let eventLatencies = {};

const observer = new PerformanceObserver((list) => {
list.getEntries().forEach((entry) => {
Expand All @@ -44,15 +44,16 @@ const observer = new PerformanceObserver((list) => {
if (!eventLatencies.has(interactionId)) {
eventLatencies[interactionId] = [];
}
eventLatencies[interactionId].push(entry.duration);
eventLatencies[interactionId].push(entry.duration);
}
});
});

observer.observe({type: "event", buffered: true});
observer.observe({ type: "event", buffered: true });

// Log events with maximum event duration for a user interaction
Object.entries(eventLatencies).forEach(([k, v]) => {
console.log(Math.max(...v));
console.log(Math.max(...v));
});
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ A {{jsxref("Map", "map")}}, with each entry being an extensions' identifier stri
const publicKey = {
// Here are the extension "inputs"
extensions: {
appid: "https://accounts.example.com"
appid: "https://accounts.example.com",
},
allowCredentials: {
id: "fgrt46jfgd...",
transports: ["usb", "nfc"]
type: "public-key"
transports: ["usb", "nfc"],
type: "public-key",
},
challenge: new Uint8Array(16) /* from the server */
challenge: new Uint8Array(16) /* from the server */,
};

navigator.credentials
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/request/signal/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ An {{DOMxRef("AbortSignal")}} object.
const controller = new AbortController();

// Create a request with this controller's AbortSignal object
const req = new Request('/', { signal: controller.signal });
const req = new Request("/", { signal: controller.signal });

// Add an event handler logging a message in case of abort
req.signal.addEventListener("abort", () => {
Expand All @@ -39,7 +39,7 @@ fetch(req).catch(() => {
} else {
console.log("Request not aborted, but terminated abnormally.");
}
};
});

// Actually abort the request
controller.abort();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ const peerConnection = new RTCPeerConnection(options);
const channel = peerConnection.createDataChannel("chat");
channel.onopen = (event) => {
const maximumMessageSize = peerConnection.sctp.maxMessageSize;
const textToSend = "This is my possibly overly long string!"
splitStringToMax(textToSend,maximumMessageSize).forEach( (elem) => {
channel.send(elem);
});
const textToSend = "This is my possibly overly long string!";
splitStringToMax(textToSend, maximumMessageSize).forEach((elem) => {
channel.send(elem);
});
};
```

## Specifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async function setUpBidirectional() {
// stream.writable is a WritableStream
const writable = stream.writable;

...
// ...
}
```

Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/media/autoplay_guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ if (navigator.getAutoplayPolicy("mediaelement") === "allowed") {
} else if (navigator.getAutoplayPolicy("mediaelement") === "allowed-muted") {
// Mute audio on video
video.muted = true;
} else (navigator.getAutoplayPolicy("mediaelement") === "disallowed") {
} else if (navigator.getAutoplayPolicy("mediaelement") === "disallowed") {
// Set a default placeholder image.
video.poster = "http://example.com/poster_image_url";
}
Expand All @@ -105,7 +105,7 @@ if (navigator.getAutoplayPolicy(video) === "allowed") {
} else if (navigator.getAutoplayPolicy(video) === "allowed-muted") {
// Mute audio on video
video.muted = true;
} else (navigator.getAutoplayPolicy(video) === "disallowed") {
} else if (navigator.getAutoplayPolicy(video) === "disallowed") {
// Set a default placeholder image.
video.poster = "http://example.com/poster_image_url";
}
Expand Down