Adding line separator in code docs above MDN URLs.

This commit is contained in:
Kevin Hoffman 2018-06-28 15:05:10 -04:00
parent 3e84b97de2
commit 81e68517f2
2 changed files with 11 additions and 3 deletions

View File

@ -389,6 +389,7 @@ extern {
/// The Math.cos() static function returns the cosine of the specified angle, /// The Math.cos() static function returns the cosine of the specified angle,
/// which must be specified in radians. This value is length(adjacent)/length(hypotenuse). /// which must be specified in radians. This value is length(adjacent)/length(hypotenuse).
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos
#[wasm_bindgen(static_method_of = Math)] #[wasm_bindgen(static_method_of = Math)]
pub fn cos(x: f32) -> Number; pub fn cos(x: f32) -> Number;
@ -396,18 +397,21 @@ extern {
/// The Math.cosh() function returns the hyperbolic cosine of a number, /// The Math.cosh() function returns the hyperbolic cosine of a number,
/// that can be expressed using the constant e. /// that can be expressed using the constant e.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh
#[wasm_bindgen(static_method_of = Math)] #[wasm_bindgen(static_method_of = Math)]
pub fn cosh(x: f32) -> Number; pub fn cosh(x: f32) -> Number;
/// The Math.exp() function returns e^x, where x is the argument, and e is Euler's number /// The Math.exp() function returns e^x, where x is the argument, and e is Euler's number
/// (also known as Napier's constant), the base of the natural logarithms. /// (also known as Napier's constant), the base of the natural logarithms.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp
#[wasm_bindgen(static_method_of = Math)] #[wasm_bindgen(static_method_of = Math)]
pub fn exp(x: f32) -> Number; pub fn exp(x: f32) -> Number;
/// The Math.expm1() function returns e^x - 1, where x is the argument, and e the base of the /// The Math.expm1() function returns e^x - 1, where x is the argument, and e the base of the
/// natural logarithms. /// natural logarithms.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1 /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1
#[wasm_bindgen(static_method_of = Math)] #[wasm_bindgen(static_method_of = Math)]
pub fn expm1(x: f32) -> Number; pub fn expm1(x: f32) -> Number;
@ -421,23 +425,27 @@ extern {
/// The Math.fround() function returns the nearest 32-bit single precision float representation /// The Math.fround() function returns the nearest 32-bit single precision float representation
/// of a Number. /// of a Number.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround
#[wasm_bindgen(static_method_of = Math)] #[wasm_bindgen(static_method_of = Math)]
pub fn fround(x: f32) -> Number; pub fn fround(x: f32) -> Number;
/// The Math.imul() function returns the result of the C-like 32-bit multiplication of the /// The Math.imul() function returns the result of the C-like 32-bit multiplication of the
/// two parameters. /// two parameters.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul
#[wasm_bindgen(static_method_of = Math)] #[wasm_bindgen(static_method_of = Math)]
pub fn imul(x: i32, y: i32) -> Number; pub fn imul(x: i32, y: i32) -> Number;
/// The Math.log() function returns the natural logarithm (base e) of a number. /// The Math.log() function returns the natural logarithm (base e) of a number.
/// The JavaScript Math.log() function is equivalent to ln(x) in mathematics. /// The JavaScript Math.log() function is equivalent to ln(x) in mathematics.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log
#[wasm_bindgen(static_method_of = Math)] #[wasm_bindgen(static_method_of = Math)]
pub fn log(x: f32) -> Number; pub fn log(x: f32) -> Number;
/// The Math.log10() function returns the base 10 logarithm of a number. /// The Math.log10() function returns the base 10 logarithm of a number.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10 /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10
#[wasm_bindgen(static_method_of = Math)] #[wasm_bindgen(static_method_of = Math)]
pub fn log10(x: f32) -> Number; pub fn log10(x: f32) -> Number;
@ -448,6 +456,7 @@ extern {
pub fn log1p(x: f32) -> Number; pub fn log1p(x: f32) -> Number;
/// The Math.log2() function returns the base 2 logarithm of a number. /// The Math.log2() function returns the base 2 logarithm of a number.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2 /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2
#[wasm_bindgen(static_method_of = Math)] #[wasm_bindgen(static_method_of = Math)]
pub fn log2(x: f32) -> Number; pub fn log2(x: f32) -> Number;

View File

@ -78,7 +78,6 @@ fn acosh() {
export function test() { export function test() {
assert.equal(wasm.acosh(1), 0); assert.equal(wasm.acosh(1), 0);
assert.equal(wasm.acosh(2), Math.acosh(2)); assert.equal(wasm.acosh(2), Math.acosh(2));
assert.equal(wasm.acosh(2), Math.acosh(2));
} }
"#) "#)
.test() .test()
@ -315,7 +314,7 @@ fn cos() {
export function test() { export function test() {
assert.equal(wasm.cos(0), 1); assert.equal(wasm.cos(0), 1);
// other assertions failing due to rounding errors assert.equal(wasm.cos(1.5), Math.cos(1.5));
} }
"#) "#)
.test() .test()