Comments (2)
area-core-library
, type-enhancement
The
Uri.origin
method throws an exception when thescheme
orhost
properties are empty or null. This behavior is unexpected and can lead to bugs, especially when dealing with unknown URIs. The user proposes thatUri.origin
should always return a value, even if thescheme
orhost
is missing, to avoid unexpected exceptions.
from sdk.
It's not technically a breaking change to make something not throw an error, but if the current origin
behavior is being used as a way to check if two different URIs have the same origin, then returning an empty string instead of an error may cause false positives.
The Dart Uri.origin
matches neither the HTML behavior nor the WhatWG URL behavior, so there is no real specification that it's failing to follow. It's not even trying.
I think returning the string "null"
would be a reasonable (and semi-compliant) behavior. Maybe we should do that.
from sdk.
Related Issues (20)
- Optimize the `dart:async` API to use functional programming HOT 2
- [vm/ffi] Custom snapshot serializer/deserializers for user-defined classes backed by native state HOT 4
- NasserFlutter_Analyzer Feedback from IntelliJ HOT 1
- Having an issue trying to convert an async function HOT 5
- Analyzer Feedback from IntelliJ HOT 1
- Analyzer Feedback from IntelliJ HOT 1
- Empty vs. null query parameters - wrong encoding in Uri HOT 5
- admin folder are listed with `Directory.list()` but `Directory.existsSync` return false on them HOT 2
- Analyzer's Comment nodes are always 'doc' comments; deprecate unused properties
- truncateAsFixed() idea HOT 1
- Types declared by a macro are not visible outside the library where the macro was applied HOT 5
- Some tests no longer work with custom local builds HOT 24
- A macro application generated by another macro is not invoked HOT 1
- Auto-generate identifiers for `record_use` HOT 1
- [native_assets] Support `dart pub global run` HOT 6
- [js_interop/dart2js] Constant fold string literals `.toJS` in dart2js HOT 3
- [js_interop/dart2wasm] Canonicalize and move `<constant-or-literal>.toJS` at compile-time to mjs file
- analysis_options.yaml "include:" not working for nested folders unless workspace root has a package config for the referenced package HOT 15
- Some javascript error are caught with an opaque JavascriptError type when using wasm HOT 3
- Network paths don't work after 3.4.0 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk.