Skip to content

Instantly share code, notes, and snippets.

View piscisaureus's full-sized avatar
🦕

Bert Belder piscisaureus

🦕
View GitHub Profile
import "./mod_a.js";
await 0;
import "./mod_b.js";
const React = {
createElement(...args) { console.log(this, ...args); return new String("ReactElement"); }
};
const foo = (...args) => { console.log(this, ...args); return "FooEl"; };
console.log(<foo>a ${111} {222} $c</foo>);
console.log("bar");
This file has been truncated, but you can view the full file.
@piscisaureus
piscisaureus / build.sh
Last active June 25, 2021 02:12
deno icons
#!/bin/sh
# This script generates multi-size .ico files from the highly stylized "simple"
# Deno logos, designed by HashRock.
# The complication stems from the fact the the dimensions of the original .png
# files is 252x252 pixels. Naively rescaling these images to 256x256 or any
# other power of 2 produces ugly artifacts.
# Note that the output of the black-and-white logo transformation isn't
const resources = {
"/": file("text/html")`
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script type="module" src="main.js"></script>
</head>
<body>
<p>Open developer tools. There will be nothing to see here.</p>
// Capture - remove by function pointer and data
void AddGCPrologueCallback(GCCallbackWithData callback, void* data = nullptr, GCType gc_type_filter = kGCTypeAll);
void RemoveGCPrologueCallback(GCCallbackWithData, void* data = nullptr);
void AddGCEpilogueCallback(GCCallbackWithData callback, void* data = nullptr, GCType gc_type_filter = kGCTypeAll);
void RemoveGCEpilogueCallback(GCCallbackWithData callback, void* data = nullptr);
void AddMicrotasksCompletedCallback(MicrotasksCompletedCallbackWithData callback, void* data = nullptr);
void RemoveMicrotasksCompletedCallback(MicrotasksCompletedCallbackWithData callback, void* data = nullptr) = 0;
First number is the size (in bytes) of the stack frame. The largest frames are on top.
+ 60480 0x000000B1E05AD690 frame #77: 0x00007ff6b6e7fd44 deno.exe`union core::result::Result<swc_ecma_ast::module::ModuleItem, swc_common::errors::diagnostic_builder::DiagnosticBuilder> swc_ecma_parser::parser::Parser<swc_ecma_parser::parser::input::Capturing<swc_ecma_parser::lexer::Lexer<swc_common::input::SourceFileInput>>>::parse_stmt_like<swc_ecma_parser::parser::input::Capturing<swc_ecma_parser::lexer::Lexer<swc_common::input::SourceFileInput>>,swc_ecma_ast::module::ModuleItem>(self=0x000000b1e05b00d0, include_decl=true, top_level=true) at stmt.rs:82
+ 60480 0x000000B1E055F110 frame #48: 0x00007ff6b6e7f784 deno.exe`union core::result::Result<swc_ecma_ast::stmt::Stmt, swc_common::errors::diagnostic_builder::DiagnosticBuilder> swc_ecma_parser::parser::Parser<swc_ecma_parser::parser::input::Capturing<swc_ecma_parser::lexer::Lexer<swc_common::input::SourceFileInput>>>::parse_stmt_like<swc_ecma_parser::parser::input:
D:\deno2\tests>..\target\debug\deno -A --reload main.js
Compile file:///D:/deno2/tests/subdir/mod2.ts
Compile file:///D:/deno2/tests/subdir/mismatch_ext.ts
Compile file:///D:/deno2/tests/subdir/mod1.ts
Download https://raw.githubusercontent.com/denoland/deno/v0.0.1/package.json
error: Uncaught Error: An error
► file:///D:/deno2/tests/subdir/throws.js:5:7
5 throw new Error("An error");
^
async function try_import(url) {
let status;
try {
await import(url);
status = "OK";
} catch (err) {
status = err.name;
}
status = status.padEnd(12);
return status + url;
So here's the things to consider:
* Do not preallocate a read buffer per socket.
Either use polling or use a shared buffer pool.
* Avoid statefulnews, e.g:
- In windows, you can't use multiple completion ports with a handle.
- On unix, a socket is either in blocking or non-blocking mode
This creates problems when you want to share a handle with other processes
or between threads. For example, you might want to switch stdout to
non-blocking, but if stdout was inherited and shared with the parent
process, the parent process might not expect this and crash or malfunction.
use std::collections::HashMap;
use std::sync::Mutex;
#[macro_use]
extern crate lazy_static;
struct CoreOp {} // Placeholder.
struct FlatBuffer {} // Placeholder.
struct PinnedBuf {} // Placeholder.