Skip to content
Closed
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
5 changes: 0 additions & 5 deletions src/bun_core/env_var.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ new!(pub BUN_INSTALL_STREAMING_MIN_SIZE: unsigned, "BUN_INSTALL_STREAMING_MIN_SI
// thread schedules a drain; collapses the per-chunk thread-pool futex wake
// into roughly one per `threshold` bytes.
new!(pub BUN_INSTALL_STREAMING_DRAIN_THRESHOLD: unsigned, "BUN_INSTALL_STREAMING_DRAIN_THRESHOLD", { default: 256 * 1024 });
new!(pub BUN_NEEDS_PROC_SELF_WORKAROUND: boolean, "BUN_NEEDS_PROC_SELF_WORKAROUND", { default: false });
new!(pub BUN_OPTIONS: string, "BUN_OPTIONS", {});
new!(pub BUN_POSTGRES_SOCKET_MONITOR: string, "BUN_POSTGRES_SOCKET_MONITOR", {});
new!(pub BUN_POSTGRES_SOCKET_MONITOR_READER: string, "BUN_POSTGRES_SOCKET_MONITOR_READER", {});
Expand Down Expand Up @@ -150,9 +149,6 @@ platform_specific_new!(pub HOME: string, posix = "HOME", windows = "USERPROFILE"
new!(pub HYPERFINE_RANDOMIZED_ENVIRONMENT_OFFSET: string, "HYPERFINE_RANDOMIZED_ENVIRONMENT_OFFSET", {});
new!(pub IS_BUN_AUTO_UPDATE: boolean, "IS_BUN_AUTO_UPDATE", { default: false });
new!(pub JENKINS_URL: string, "JENKINS_URL", {});
// Dump mimalloc statistics at the end of the process. Note that this is not the same as
// `MIMALLOC_VERBOSE`, documented here: https://microsoft.github.io/mimalloc/environment.html
new!(pub MI_VERBOSE: boolean, "MI_VERBOSE", { default: false });
new!(pub NO_COLOR: boolean, "NO_COLOR", { default: false });
new!(pub NODE_CHANNEL_FD: string, "NODE_CHANNEL_FD", {});
// A string, not a boolean: node suppresses warnings only when the value is
Expand Down Expand Up @@ -183,7 +179,6 @@ new!(pub TERM_PROGRAM: string, "TERM_PROGRAM", {});
platform_specific_new!(pub TMP: string, posix = "TMP", windows = "TMP", {});
platform_specific_new!(pub TMPDIR: string, posix = "TMPDIR", windows = "TMPDIR", {});
new!(pub TMUX: string, "TMUX", {});
new!(pub TODIUM: string, "TODIUM", {});
platform_specific_new!(pub USER: string, posix = "USER", windows = "USERNAME", {});
new!(pub WANTS_LOUD: boolean, "WANTS_LOUD", { default: false });
// The same as system_root.
Expand Down
3 changes: 0 additions & 3 deletions src/bun_core/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,6 @@ pub enum ColorCode {
Blue,
Orange,
Red,
Pink,
}

impl ColorCode {
Expand All @@ -1515,8 +1514,6 @@ impl ColorCode {
ColorCode::Blue => "\x1b[34m",
ColorCode::Orange => "\x1b[33m",
ColorCode::Red => "\x1b[31m",
// light pink
ColorCode::Pink => "\x1b[38;5;206m",
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/bundler/LinkerContext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4392,15 +4392,13 @@ impl StmtList {
StmtListWhich::InsideWrapperSuffix => {
self.inside_wrapper_suffix.extend_from_slice(stmts)
}
StmtListWhich::AllStmts => self.all_stmts.extend_from_slice(stmts),
}
}

pub(crate) fn append(&mut self, list: StmtListWhich, stmt: Stmt) {
match list {
StmtListWhich::OutsideWrapperPrefix => self.outside_wrapper_prefix.push(stmt),
StmtListWhich::InsideWrapperSuffix => self.inside_wrapper_suffix.push(stmt),
StmtListWhich::AllStmts => self.all_stmts.push(stmt),
}
}
}
Expand All @@ -4409,5 +4407,4 @@ impl StmtList {
pub enum StmtListWhich {
OutsideWrapperPrefix,
InsideWrapperSuffix,
AllStmts,
}
11 changes: 0 additions & 11 deletions src/css/css_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,6 @@ impl<'a> CustomAtRuleParser for BundlerAtRuleParser<'a> {

pub enum AtRulePrelude<T> {
FontFace,
FontFeatureValues,
FontPaletteValues(DashedIdent),
CounterStyle(CustomIdent),
Import {
Expand Down Expand Up @@ -1894,7 +1893,6 @@ mod rule_parsers {
}));
Ok(())
}
AtRulePrelude::FontFeatureValues => unreachable!(),
AtRulePrelude::Unknown { name, tokens } => {
this.rules.v.push(CssRule::Unknown(UnknownAtRule {
name,
Expand Down Expand Up @@ -2472,9 +2470,6 @@ mod stylesheet_impl {
printer: &mut Printer<'a>,
project_root: Option<&[u8]>,
) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")] { printer.sources = Some(&self.sources); }
// #[cfg(feature = "sourcemap")] if printer.source_map.is_some() { ... }

for comment in &self.license_comments {
printer.write_str("/*")?;
printer.write_comment(comment)?;
Expand Down Expand Up @@ -2716,12 +2711,6 @@ mod stylesheet_impl {
options: &PrinterOptions<'a>,
import_info: Option<ImportInfo<'a>>,
) -> Result<ToCssResult, PrintErr> {
// #[cfg(feature = "sourcemap")]
// assert!(
// options.source_map.is_none(),
// "Source maps are not supported for style attributes"
// );

let symbols = bun_ast::symbol::Map::init_list(Default::default());
let mut dest: Vec<u8> = Vec::new();
let mut printer = Printer::new(
Expand Down
6 changes: 0 additions & 6 deletions src/css/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,6 @@ pub enum SelectorError {
empty_selector,
/// A `|` was expected in an attribute selector.
expected_bar_in_attr(Token),
/// A namespace was expected.
expected_namespace(Str),
/// An unexpected token was encountered in a namespace.
explicit_namespace_unexpected_token(Token),
/// An invalid pseudo class was encountered after a pseudo element.
Expand All @@ -383,8 +381,6 @@ pub enum SelectorError {
no_qualified_name_in_attribute_selector(Token),
/// An invalid token was encountered in a pseudo element.
pseudo_element_expected_ident(Token),
/// An unexpected identifier was encountered.
unexpected_ident(Str),
/// An unexpected token was encountered inside an attribute selector.
unexpected_token_in_attribute_selector(Token),
/// An unsupported pseudo class or pseudo element was encountered.
Expand Down Expand Up @@ -415,8 +411,6 @@ impl fmt::Display for SelectorError {
f.write_str("-webkit-scrollbar state found before -webkit-scrollbar pseudo-element")
}

Self::expected_namespace(s) => write!(f, "Expected namespace '{}'", bs(*s)),
Self::unexpected_ident(s) => write!(f, "Unexpected identifier '{}'", bs(*s)),
Self::unsupported_pseudo_class_or_element(s) => {
write!(f, "Unsupported pseudo-class or pseudo-element '{}'", bs(*s))
}
Expand Down
1 change: 0 additions & 1 deletion src/css/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ impl<'a> ImportInfo<'a> {
/// `Printer` also includes helper functions that assist with writing output
/// that respects options such as `minify`, and `css_modules`.
pub struct Printer<'a> {
// #[cfg(feature = "sourcemap")]
pub(crate) sources: Option<&'a Vec<Box<[u8]>>>,
pub dest: &'a mut dyn Write,
pub(crate) loc: Location,
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,6 @@ pub struct ContainerRule<R> {

impl<R> ContainerRule<R> {
pub(crate) fn to_css(&self, dest: &mut Printer) -> core::result::Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_str("@container ")?;
if let Some(name) = &self.name {
name.to_css(dest)?;
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/counter_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ pub struct CounterStyleRule {

impl CounterStyleRule {
pub(crate) fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_str("@counter-style")?;
super::custom_ident_to_css(&self.name, dest)?;
super::decl_block_to_css(&self.declarations, dest)
Expand Down
2 changes: 0 additions & 2 deletions src/css/rules/custom_media.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ impl CustomMediaRule {
}

pub fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);
dest.write_str("@custom-media ")?;
DashedIdentFns::to_css(&self.name, dest)?;
dest.write_char(b' ')?;
Expand Down
2 changes: 0 additions & 2 deletions src/css/rules/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ pub struct MozDocumentRule<R> {

impl<R> MozDocumentRule<R> {
pub(crate) fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);
dest.write_str("@-moz-document url-prefix()")?;
dest.block(|d| {
d.newline()?;
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/font_face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,6 @@ pub struct FontFaceRule {

impl FontFaceRule {
pub(crate) fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_str("@font-face")?;
dest.whitespace()?;
dest.write_char(b'{')?;
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/font_palette_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ pub struct FontPaletteValuesRule {

impl FontPaletteValuesRule {
pub(crate) fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_str("@font-palette-values ")?;
super::dashed_ident_to_css(&self.name, dest)?;
dest.whitespace()?;
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,6 @@ impl ImportRule {
None
};

// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_str("@import ")?;
if let Some(d) = dep {
// SAFETY: `placeholder` is arena-allocated by `css_modules::hash`
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/keyframes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,6 @@ pub struct KeyframesRule {

impl KeyframesRule {
pub(crate) fn to_css(&self, dest: &mut Printer) -> core::result::Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

let mut first_rule = true;

// VendorPrefix is `bitflags!`, so iterate the flag constants directly
Expand Down
5 changes: 0 additions & 5 deletions src/css/rules/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ impl<R> LayerBlockRule<R> {
}

pub fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_str("@layer")?;
if let Some(name) = &self.name {
dest.write_char(b' ')?;
Expand Down Expand Up @@ -192,8 +189,6 @@ impl LayerStatementRule {
}

pub fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);
if self.names.len() > 0 {
dest.write_str("@layer ")?;
css::to_css::from_list(self.names.slice(), dest)?;
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/media.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ impl<R> MediaRule<R> {
self.rules.to_css(dest)?;
return Ok(());
}
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_str("@media ")?;
self.query.to_css(dest)?;
dest.block(|d| {
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ pub struct NamespaceRule {

impl NamespaceRule {
pub fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_str("@namespace ")?;
if let Some(prefix) = &self.prefix {
prefix.to_css(dest)?;
Expand Down
2 changes: 0 additions & 2 deletions src/css/rules/nesting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ pub struct NestingRule<R> {

impl<R> NestingRule<R> {
pub(crate) fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);
if dest.context().is_none() {
dest.write_str("@nest ")?;
}
Expand Down
5 changes: 0 additions & 5 deletions src/css/rules/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ pub struct PageMarginRule {

impl PageMarginRule {
fn to_css(&self, dest: &mut Printer) -> core::result::Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_char(b'@')?;
self.margin_box.to_css(dest)?;
super::decl_block_to_css(&self.declarations, dest)
Expand Down Expand Up @@ -122,8 +119,6 @@ pub struct PageRule {

impl PageRule {
pub(crate) fn to_css(&self, dest: &mut Printer) -> core::result::Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);
dest.write_str("@page")?;
if self.selectors.len() >= 1 {
let firstsel = &self.selectors[0];
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ pub struct PropertyRule {

impl PropertyRule {
pub(crate) fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_str("@property ")?;
super::dashed_ident_to_css(&self.name, dest)?;
dest.whitespace()?;
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ pub struct ScopeRule<R> {
impl<R> ScopeRule<R> {
pub fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
use crate::selectors::selector::serialize::serialize_selector_list;
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_str("@scope")?;
dest.whitespace()?;
// The scope preludes get their own budget for `&` substitutions when
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/starting_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ pub struct StartingStyleRule<R> {

impl<R> StartingStyleRule<R> {
pub(crate) fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_str("@starting-style")?;
dest.block(|d| {
d.newline()?;
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ impl<R> StyleRule<R> {
let has_declarations = supports_nesting || len > 0 || self.rules.v.len() == 0;

if has_declarations {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

// `dest.context()` borrows `dest`; copy the (Copy) raw
// ctx field out so it doesn't conflict with the `&mut *dest` below.
let ctx = dest.ctx;
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/supports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,6 @@ impl<R> SupportsRule<R> {

impl<R> SupportsRule<R> {
pub fn to_css(&self, dest: &mut Printer) -> core::result::Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_str(b"@supports ")?;
self.condition.to_css(dest)?;
dest.block(|d| {
Expand Down
3 changes: 0 additions & 3 deletions src/css/rules/unknown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ pub struct UnknownAtRule {

impl UnknownAtRule {
pub fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);

dest.write_char(b'@')?;
dest.serialize_identifier(self.name)?;

Expand Down
2 changes: 0 additions & 2 deletions src/css/rules/viewport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ pub struct ViewportRule {

impl ViewportRule {
pub(crate) fn to_css(&self, dest: &mut Printer) -> Result<(), PrintErr> {
// #[cfg(feature = "sourcemap")]
// dest.add_mapping(self.loc);
dest.write_char(b'@')?;
super::vendor_prefix_to_css(self.vendor_prefix, dest)?;
dest.write_str("viewport")?;
Expand Down
4 changes: 0 additions & 4 deletions src/css/selectors/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2827,10 +2827,8 @@ pub enum SelectorParseErrorKind {
InvalidPseudoClassAfterPseudoElement,
MissingNestingSelector,
MissingNestingPrefix,
ExpectedNamespace(Str),
BadValueInAttr(Token),
ExplicitNamespaceUnexpectedToken(Token),
UnexpectedIdent(Str),
AmbiguousCssModuleClass(Str),
}

Expand Down Expand Up @@ -2870,12 +2868,10 @@ impl SelectorParseErrorKind {
K::InvalidPseudoClassAfterPseudoElement => S::invalid_pseudo_class_after_pseudo_element,
K::MissingNestingSelector => S::missing_nesting_selector,
K::MissingNestingPrefix => S::missing_nesting_prefix,
K::ExpectedNamespace(name) => S::expected_namespace(name),
K::BadValueInAttr(token) => S::bad_value_in_attr(token),
K::ExplicitNamespaceUnexpectedToken(token) => {
S::explicit_namespace_unexpected_token(token)
}
K::UnexpectedIdent(ident) => S::unexpected_ident(ident),
K::UnexpectedSelectorAfterPseudoElement(tok) => {
S::unexpected_selector_after_pseudo_element(tok)
}
Expand Down
2 changes: 0 additions & 2 deletions src/http/lshpack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ pub struct DecodeResult {
pub name: &'static [u8],
pub value: &'static [u8],
pub never_index: bool,
pub well_know: u16,
/// offset of the next header position in src
pub next: usize,
}
Expand Down Expand Up @@ -82,7 +81,6 @@ impl HPACK {
value,
next: offset,
never_index: header.never_index,
well_know: header.hpack_index,
})
}

Expand Down
Loading
Loading