Browse Source

Fix unresolved links in documentation (#960)

* Fix unresolved links in documentation

* Fix more unresolved links

* Fix even more unresolved links

* Fix more links

* Treat variables as code

Co-authored-by: Iban Eguia <razican@protonmail.ch>

Co-authored-by: tofpie <tofpie@users.noreply.github.com>
Co-authored-by: Iban Eguia <razican@protonmail.ch>
pull/965/head
tofpie 4 years ago committed by GitHub
parent
commit
0c068cb35b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      boa/src/builtins/boolean/mod.rs
  2. 2
      boa/src/builtins/function/mod.rs
  3. 2
      boa/src/builtins/map/map_iterator.rs
  4. 2
      boa/src/builtins/number/conversions.rs
  5. 6
      boa/src/builtins/number/mod.rs
  6. 1
      boa/src/builtins/object/mod.rs
  7. 2
      boa/src/context.rs
  8. 8
      boa/src/environment/function_environment_record.rs
  9. 2
      boa/src/object/gcobject.rs
  10. 13
      boa/src/object/internal_methods.rs
  11. 4
      boa/src/object/mod.rs
  12. 4
      boa/src/property/mod.rs
  13. 2
      boa/src/syntax/ast/node/field/get_field/mod.rs
  14. 6
      boa/src/syntax/ast/op.rs
  15. 2
      boa/src/syntax/parser/statement/mod.rs
  16. 8
      boa/src/value/mod.rs
  17. 4
      boa/src/value/type.rs

2
boa/src/builtins/boolean/mod.rs

@ -64,7 +64,7 @@ impl Boolean {
Ok(Value::from(data)) Ok(Value::from(data))
} }
/// An Utility function used to get the internal [[BooleanData]]. /// An Utility function used to get the internal `[[BooleanData]]`.
/// ///
/// More information: /// More information:
/// - [ECMAScript reference][spec] /// - [ECMAScript reference][spec]

2
boa/src/builtins/function/mod.rs

@ -208,7 +208,7 @@ pub fn create_unmapped_arguments_object(arguments_list: &[Value]) -> Value {
/// name: The name of the function (how it will be called but without the ()). /// name: The name of the function (how it will be called but without the ()).
/// parent: The object to register the function on, if the global object is used then the function is instead called as name() /// parent: The object to register the function on, if the global object is used then the function is instead called as name()
/// without requiring the parent, see parseInt() as an example. /// without requiring the parent, see parseInt() as an example.
/// length: As described at https://tc39.es/ecma262/#sec-function-instances-length, The value of the "length" property is an integer that /// length: As described at <https://tc39.es/ecma262/#sec-function-instances-length>, The value of the "length" property is an integer that
/// indicates the typical number of arguments expected by the function. However, the language permits the function to be invoked with /// indicates the typical number of arguments expected by the function. However, the language permits the function to be invoked with
/// some other number of arguments. /// some other number of arguments.
/// ///

2
boa/src/builtins/map/map_iterator.rs

@ -18,7 +18,7 @@ pub enum MapIterationKind {
/// More information: /// More information:
/// - [ECMAScript reference][spec] /// - [ECMAScript reference][spec]
/// ///
/// [spec]: TODO https://tc39.es/ecma262/#sec-array-iterator-objects /// [spec]: https://tc39.es/ecma262/#sec-array-iterator-objects
#[derive(Debug, Clone, Finalize, Trace)] #[derive(Debug, Clone, Finalize, Trace)]
pub struct MapIterator { pub struct MapIterator {
iterated_map: Value, iterated_map: Value,

2
boa/src/builtins/number/conversions.rs

@ -79,7 +79,7 @@ pub(crate) fn f64_to_int32(number: f64) -> i32 {
/// Converts a 64-bit floating point number to an `u32` according to the [`ToUint32`][ToUint32] algorithm. /// Converts a 64-bit floating point number to an `u32` according to the [`ToUint32`][ToUint32] algorithm.
/// ///
// [ToInt32]: https://tc39.es/ecma262/#sec-touint32 /// [ToUint32]: https://tc39.es/ecma262/#sec-touint32
#[inline] #[inline]
pub(crate) fn f64_to_uint32(number: f64) -> u32 { pub(crate) fn f64_to_uint32(number: f64) -> u32 {
f64_to_int32(number) as u32 f64_to_int32(number) as u32

6
boa/src/builtins/number/mod.rs

@ -774,7 +774,7 @@ impl Number {
/// The abstract operation Number::equal takes arguments /// The abstract operation Number::equal takes arguments
/// x (a Number) and y (a Number). It performs the following steps when called: /// x (a Number) and y (a Number). It performs the following steps when called:
/// ///
/// https://tc39.es/ecma262/#sec-numeric-types-number-equal /// <https://tc39.es/ecma262/#sec-numeric-types-number-equal>
#[inline] #[inline]
#[allow(clippy::float_cmp)] #[allow(clippy::float_cmp)]
pub(crate) fn equal(x: f64, y: f64) -> bool { pub(crate) fn equal(x: f64, y: f64) -> bool {
@ -784,7 +784,7 @@ impl Number {
/// The abstract operation Number::sameValue takes arguments /// The abstract operation Number::sameValue takes arguments
/// x (a Number) and y (a Number). It performs the following steps when called: /// x (a Number) and y (a Number). It performs the following steps when called:
/// ///
/// https://tc39.es/ecma262/#sec-numeric-types-number-sameValue /// <https://tc39.es/ecma262/#sec-numeric-types-number-sameValue>
#[allow(clippy::float_cmp)] #[allow(clippy::float_cmp)]
pub(crate) fn same_value(a: f64, b: f64) -> bool { pub(crate) fn same_value(a: f64, b: f64) -> bool {
if a.is_nan() && b.is_nan() { if a.is_nan() && b.is_nan() {
@ -806,7 +806,7 @@ impl Number {
/// The abstract operation Number::sameValueZero takes arguments /// The abstract operation Number::sameValueZero takes arguments
/// x (a Number) and y (a Number). It performs the following steps when called: /// x (a Number) and y (a Number). It performs the following steps when called:
/// ///
/// https://tc39.es/ecma262/#sec-numeric-types-number-sameValueZero /// <https://tc39.es/ecma262/#sec-numeric-types-number-sameValueZero>
#[inline] #[inline]
#[allow(clippy::float_cmp)] #[allow(clippy::float_cmp)]
pub(crate) fn same_value_zero(x: f64, y: f64) -> bool { pub(crate) fn same_value_zero(x: f64, y: f64) -> bool {

1
boa/src/builtins/object/mod.rs

@ -194,6 +194,7 @@ impl Object {
/// The abstract operation `FromPropertyDescriptor`. /// The abstract operation `FromPropertyDescriptor`.
/// ///
/// [ECMAScript reference][spec] /// [ECMAScript reference][spec]
///
/// [spec]: https://tc39.es/ecma262/#sec-frompropertydescriptor /// [spec]: https://tc39.es/ecma262/#sec-frompropertydescriptor
fn from_property_descriptor(desc: PropertyDescriptor, context: &mut Context) -> Result<Value> { fn from_property_descriptor(desc: PropertyDescriptor, context: &mut Context) -> Result<Value> {
let mut descriptor = ObjectInitializer::new(context); let mut descriptor = ObjectInitializer::new(context);

2
boa/src/context.rs

@ -572,7 +572,7 @@ impl Context {
Err(()) Err(())
} }
/// https://tc39.es/ecma262/#sec-hasproperty /// <https://tc39.es/ecma262/#sec-hasproperty>
#[inline] #[inline]
pub(crate) fn has_property(&self, obj: &Value, key: &PropertyKey) -> bool { pub(crate) fn has_property(&self, obj: &Value, key: &PropertyKey) -> bool {
if let Some(obj) = obj.as_object() { if let Some(obj) = obj.as_object() {

8
boa/src/environment/function_environment_record.rs

@ -47,11 +47,11 @@ pub struct FunctionEnvironmentRecord {
/// The function object whose invocation caused this Environment Record to be created. /// The function object whose invocation caused this Environment Record to be created.
pub function: GcObject, pub function: GcObject,
/// If the associated function has super property accesses and is not an ArrowFunction, /// If the associated function has super property accesses and is not an ArrowFunction,
/// [[HomeObject]] is the object that the function is bound to as a method. /// `[[HomeObject]]` is the object that the function is bound to as a method.
/// The default value for [[HomeObject]] is undefined. /// The default value for `[[HomeObject]]` is undefined.
pub home_object: Value, pub home_object: Value,
/// If this Environment Record was created by the [[Construct]] internal method, /// If this Environment Record was created by the `[[Construct]]` internal method,
/// [[NewTarget]] is the value of the [[Construct]] newTarget parameter. /// `[[NewTarget]]` is the value of the `[[Construct]]` newTarget parameter.
/// Otherwise, its value is undefined. /// Otherwise, its value is undefined.
pub new_target: Value, pub new_target: Value,
/// Reference to the outer environment to help with the scope chain /// Reference to the outer environment to help with the scope chain

2
boa/src/object/gcobject.rs

@ -288,7 +288,7 @@ impl GcObject {
/// The spec doesn't mention what to do in this situation, but a naive implementation /// The spec doesn't mention what to do in this situation, but a naive implementation
/// would overflow the stack recursively calling `toString()`. We follow v8 and SpiderMonkey /// would overflow the stack recursively calling `toString()`. We follow v8 and SpiderMonkey
/// instead by returning a default value for the given `hint` -- either `0.` or `""`. /// instead by returning a default value for the given `hint` -- either `0.` or `""`.
/// Example in v8: https://repl.it/repls/IvoryCircularCertification#index.js /// Example in v8: <https://repl.it/repls/IvoryCircularCertification#index.js>
/// ///
/// More information: /// More information:
/// - [ECMAScript][spec] /// - [ECMAScript][spec]

13
boa/src/object/internal_methods.rs

@ -69,8 +69,8 @@ impl GcObject {
} }
} }
/// [[Get]] /// `[[Get]]`
/// https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver /// <https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver>
pub fn get(&self, key: &PropertyKey) -> Value { pub fn get(&self, key: &PropertyKey) -> Value {
match self.get_own_property(key) { match self.get_own_property(key) {
None => { None => {
@ -90,7 +90,7 @@ impl GcObject {
} }
} }
/// [[Set]] /// `[[Set]]`
/// <https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-set-p-v-receiver> /// <https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-set-p-v-receiver>
pub fn set(&mut self, key: PropertyKey, val: Value) -> bool { pub fn set(&mut self, key: PropertyKey, val: Value) -> bool {
let _timer = BoaProfiler::global().start_event("Object::set", "object"); let _timer = BoaProfiler::global().start_event("Object::set", "object");
@ -239,7 +239,7 @@ impl GcObject {
/// More information: /// More information:
/// - [ECMAScript reference][spec] /// - [ECMAScript reference][spec]
/// ///
/// [spec](https://tc39.es/ecma262/#table-essential-internal-methods) /// [spec]: https://tc39.es/ecma262/#table-essential-internal-methods
#[inline] #[inline]
pub fn own_property_keys(&self) -> Vec<PropertyKey> { pub fn own_property_keys(&self) -> Vec<PropertyKey> {
self.borrow().keys().collect() self.borrow().keys().collect()
@ -323,6 +323,7 @@ impl GcObject {
/// - [MDN documentation][mdn] /// - [MDN documentation][mdn]
/// ///
/// [spec]: https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-getprototypeof /// [spec]: https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-getprototypeof
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf
#[inline] #[inline]
pub fn get_prototype_of(&self) -> Value { pub fn get_prototype_of(&self) -> Value {
self.borrow().prototype.clone() self.borrow().prototype.clone()
@ -362,7 +363,7 @@ impl GcObject {
self.insert(key.into(), DataDescriptor::new(value, attribute)) self.insert(key.into(), DataDescriptor::new(value, attribute))
} }
/// It determines if Object is a callable function with a [[Call]] internal method. /// It determines if Object is a callable function with a `[[Call]]` internal method.
/// ///
/// More information: /// More information:
/// - [EcmaScript reference][spec] /// - [EcmaScript reference][spec]
@ -374,7 +375,7 @@ impl GcObject {
self.borrow().is_callable() self.borrow().is_callable()
} }
/// It determines if Object is a function object with a [[Construct]] internal method. /// It determines if Object is a function object with a `[[Construct]]` internal method.
/// ///
/// More information: /// More information:
/// - [EcmaScript reference][spec] /// - [EcmaScript reference][spec]

4
boa/src/object/mod.rs

@ -245,7 +245,7 @@ impl Object {
} }
} }
/// It determines if Object is a callable function with a [[Call]] internal method. /// It determines if Object is a callable function with a `[[Call]]` internal method.
/// ///
/// More information: /// More information:
/// - [EcmaScript reference][spec] /// - [EcmaScript reference][spec]
@ -256,7 +256,7 @@ impl Object {
matches!(self.data, ObjectData::Function(ref f) if f.is_callable()) matches!(self.data, ObjectData::Function(ref f) if f.is_callable())
} }
/// It determines if Object is a function object with a [[Construct]] internal method. /// It determines if Object is a function object with a `[[Construct]]` internal method.
/// ///
/// More information: /// More information:
/// - [EcmaScript reference][spec] /// - [EcmaScript reference][spec]

4
boa/src/property/mod.rs

@ -228,7 +228,7 @@ pub enum PropertyDescriptor {
} }
impl PropertyDescriptor { impl PropertyDescriptor {
/// An accessor Property Descriptor is one that includes any fields named either [[Get]] or [[Set]]. /// An accessor Property Descriptor is one that includes any fields named either `[[Get]]` or `[[Set]]`.
/// ///
/// More information: /// More information:
/// - [ECMAScript reference][spec] /// - [ECMAScript reference][spec]
@ -248,7 +248,7 @@ impl PropertyDescriptor {
} }
} }
/// A data Property Descriptor is one that includes any fields named either [[Value]] or [[Writable]]. /// A data Property Descriptor is one that includes any fields named either `[[Value]]` or `[[Writable]]`.
/// ///
/// More information: /// More information:
/// - [ECMAScript reference][spec] /// - [ECMAScript reference][spec]

2
boa/src/syntax/ast/node/field/get_field/mod.rs

@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize};
/// This property accessor provides access to an object's properties by using the /// This property accessor provides access to an object's properties by using the
/// [bracket notation][mdn]. /// [bracket notation][mdn].
/// ///
/// In the object[property_name] syntax, the property_name is just a string or /// In the object\[property_name\] syntax, the property_name is just a string or
/// [Symbol][symbol]. So, it can be any string, including '1foo', '!bar!', or even ' ' (a /// [Symbol][symbol]. So, it can be any string, including '1foo', '!bar!', or even ' ' (a
/// space). /// space).
/// ///

6
boa/src/syntax/ast/op.rs

@ -677,10 +677,10 @@ pub enum LogOp {
/// Syntax: `x || y` /// Syntax: `x || y`
/// ///
/// More information: /// More information:
/// - [ECMAScript reference]( /// - [ECMAScript reference][spec]
/// - [MDN documentation][mdn] /// - [MDN documentation][mdn]
/// ///
/// [spec]: https://tc39.es/ecma262/#prod-LogicalORExpression) /// [spec]: https://tc39.es/ecma262/#prod-LogicalORExpression
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators#Logical_OR /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators#Logical_OR
Or, Or,
} }
@ -822,7 +822,7 @@ pub enum AssignOp {
/// ///
/// More information: /// More information:
/// - [ECMAScript reference][spec] /// - [ECMAScript reference][spec]
/// - [MDN documentation](mdn) /// - [MDN documentation][mdn]
/// ///
/// [spec]: https://tc39.es/ecma262/#prod-AssignmentOperator /// [spec]: https://tc39.es/ecma262/#prod-AssignmentOperator
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Assignment_Operators#Subtraction_assignment /// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Assignment_Operators#Subtraction_assignment

2
boa/src/syntax/parser/statement/mod.rs

@ -398,7 +398,7 @@ where
{ {
type Output = Box<str>; type Output = Box<str>;
/// Strict mode parsing as per https://tc39.es/ecma262/#sec-identifiers-static-semantics-early-errors. /// Strict mode parsing as per <https://tc39.es/ecma262/#sec-identifiers-static-semantics-early-errors>.
fn parse(self, cursor: &mut Cursor<R>) -> Result<Self::Output, ParseError> { fn parse(self, cursor: &mut Cursor<R>) -> Result<Self::Output, ParseError> {
let _timer = BoaProfiler::global().start_event("BindingIdentifier", "Parsing"); let _timer = BoaProfiler::global().start_event("BindingIdentifier", "Parsing");

8
boa/src/value/mod.rs

@ -247,8 +247,8 @@ impl Value {
/// For scalar types it should be false, for objects check the private field for extensibilaty. /// For scalar types it should be false, for objects check the private field for extensibilaty.
/// By default true. /// By default true.
/// ///
/// <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal would turn extensible to false/> /// <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal> would turn `extensible` to `false`
/// <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze would also turn extensible to false/> /// <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze> would also turn `extensible` to `false`
pub fn is_extensible(&self) -> bool { pub fn is_extensible(&self) -> bool {
true true
} }
@ -446,7 +446,7 @@ impl Value {
} }
/// Resolve the property in the object and get its value, or undefined if this is not an object or the field doesn't exist /// Resolve the property in the object and get its value, or undefined if this is not an object or the field doesn't exist
/// get_field recieves a Property from get_prop(). It should then return the [[Get]] result value if that's set, otherwise fall back to [[Value]] /// get_field receives a Property from get_prop(). It should then return the `[[Get]]` result value if that's set, otherwise fall back to `[[Value]]`
/// TODO: this function should use the get Value if its set /// TODO: this function should use the get Value if its set
pub fn get_field<K>(&self, key: K) -> Self pub fn get_field<K>(&self, key: K) -> Self
where where
@ -798,7 +798,7 @@ impl Value {
/// ///
/// This function is equivalent to the unary `+` operator (`+value`) in JavaScript /// This function is equivalent to the unary `+` operator (`+value`) in JavaScript
/// ///
/// See: https://tc39.es/ecma262/#sec-tonumber /// See: <https://tc39.es/ecma262/#sec-tonumber>
pub fn to_number(&self, context: &mut Context) -> Result<f64> { pub fn to_number(&self, context: &mut Context) -> Result<f64> {
match *self { match *self {
Value::Null => Ok(0.0), Value::Null => Ok(0.0),

4
boa/src/value/type.rs

@ -1,6 +1,6 @@
use super::Value; use super::Value;
/// Possible types of values as defined at https://tc39.es/ecma262/#sec-typeof-operator. /// Possible types of values as defined at <https://tc39.es/ecma262/#sec-typeof-operator>.
/// Note that an object which implements call is referred to here as 'Function'. /// Note that an object which implements call is referred to here as 'Function'.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum Type { pub enum Type {
@ -34,7 +34,7 @@ impl Type {
impl Value { impl Value {
/// Get the type of the value. /// Get the type of the value.
/// ///
/// This is similar to typeof as described at https://tc39.es/ecma262/#sec-typeof-operator but instead of /// This is similar to typeof as described at <https://tc39.es/ecma262/#sec-typeof-operator> but instead of
/// returning a string it returns a Type enum which implements fmt::Display to allow getting the string if /// returning a string it returns a Type enum which implements fmt::Display to allow getting the string if
/// required using to_string(). /// required using to_string().
pub fn get_type(&self) -> Type { pub fn get_type(&self) -> Type {

Loading…
Cancel
Save