diff --git a/doc/api/ffi.md b/doc/api/ffi.md index 28ca2f9dd1427d..0dba9d48c90677 100644 --- a/doc/api/ffi.md +++ b/doc/api/ffi.md @@ -96,8 +96,8 @@ These type names are also exposed as constants on `ffi.types`: * `ffi.types.UINT_32` = `'uint32'` * `ffi.types.INT_64` = `'int64'` * `ffi.types.UINT_64` = `'uint64'` -* `ffi.types.FLOAT_32` = `'float32'` -* `ffi.types.FLOAT_64` = `'float64'` +* `ffi.types.FLOAT_32` = `'f32'` +* `ffi.types.FLOAT_64` = `'f64'` Pointer-like types (`pointer`, `string`, `buffer`, `arraybuffer`, and `function`) are all passed through the native layer as pointers. diff --git a/lib/ffi.js b/lib/ffi.js index b276f4b29dfcdc..6355cc99dac821 100644 --- a/lib/ffi.js +++ b/lib/ffi.js @@ -190,8 +190,8 @@ const types = ObjectFreeze({ UINT_32: 'uint32', INT_64: 'int64', UINT_64: 'uint64', - FLOAT_32: 'float32', - FLOAT_64: 'float64', + FLOAT_32: 'f32', + FLOAT_64: 'f64', }); diff --git a/test/ffi/test-ffi-module.js b/test/ffi/test-ffi-module.js index 1cd2b840097d6b..ce45a2235f33cb 100644 --- a/test/ffi/test-ffi-module.js +++ b/test/ffi/test-ffi-module.js @@ -173,8 +173,8 @@ test('ffi.types exports canonical type constants', () => { UINT_32: 'uint32', INT_64: 'int64', UINT_64: 'uint64', - FLOAT_32: 'float32', - FLOAT_64: 'float64', + FLOAT_32: 'f32', + FLOAT_64: 'f64', }; assert.deepStrictEqual(ffi.types, expected);