This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const originalError = console.error; | |
console.error = function(...args) { | |
originalError(...args, "foo"); | |
} | |
//# sourceMappingURL=data:... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MagicString from 'magic-string'; | |
import open from 'open'; | |
function magic_string_replace_all(src, search, replace) { | |
let idx = src.original.indexOf(search); | |
if (idx == -1) throw new Error('search not found in src'); | |
do { | |
src.update(idx, idx + search.length, replace, {storeName: true}); | |
} while ((idx = src.original.indexOf(search, idx + 1)) != -1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2022 Benedikt Meurer. All rights reserved. | |
// | |
// Run this test with | |
// | |
// d8 --enable-inspector standalone.js -- -1 | |
// | |
// to measure with the inspector disabled, or with | |
// | |
// d8 --enable-inspector standalone.js -- 0 | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2013-2019 Benedikt Meurer | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// <https://www.apache.org/licenses/LICENSE-2.0> | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2013-2019 Benedikt Meurer | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// <https://www.apache.org/licenses/LICENSE-2.0> | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- dist/prerender_ORIG.js 2019-01-28 11:32:34.000000000 +0100 | |
+++ dist/prerender.js 2019-01-28 11:33:58.000000000 +0100 | |
@@ -88604,66 +88604,7 @@ | |
serialize: { value: function() { | |
var s = ''; | |
for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { | |
- s += kid._serializeOne(this); | |
- } | |
- return s; | |
- }}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Microbenchmark to investigate https://twitter.com/DasSurma/status/927324384238473222 | |
var isEvenNum = (num = 1) => num !== 0 && num % 2 === 0; | |
var sqrNum = num => num * num; | |
var N = 1000; | |
var arr = []; | |
for (n = 1; n <= 10000; ++n) arr.push(n); | |
function multiloops() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Benchmark for the PR https://github.com/babel/babel/pull/6748 | |
"use strict"; | |
// Object with no enumerable properties in the prototype chain. | |
const a = {x:1, y:2, z:3}; | |
// Object with enumerable properties in the prototype chain. | |
function B() { this.x = 1; this.y = 2; this.z = 3; } | |
B.prototype.foo = 4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Benchmark to measure loops running until OOB vs. loops that run | |
// to length. See | |
// | |
// https://v8project.blogspot.de/2017/09/elements-kinds-in-v8.html#avoid-reading-beyond-length | |
// | |
// for background. While OOB access is now no longer almost 10x | |
// slower in V8, it's still an anti-pattern that should be avoided. | |
"use strict"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Isolated test case for the discussion around rest parameters for Node's EventEmitter | |
// https://github.com/nodejs/node/pull/13155#issuecomment-334706721 | |
if (typeof console === 'undefined') console = {log:print}; | |
const N = 2e7; | |
const TESTS = []; | |
(function() { | |
function emitNone(handler, isFn, self) { | |
if (isFn) |
NewerOlder