Skip to content

Commit 29270fb

Browse files
committed
refactor: use utility to set properties
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent b5fed93 commit 29270fb

File tree

1 file changed

+3
-13
lines changed
  • lib/node_modules/@stdlib/complex/float64/ctor/lib

1 file changed

+3
-13
lines changed

lib/node_modules/@stdlib/complex/float64/ctor/lib/main.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// MODULES //
2222

2323
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
24-
var defineProperty = require( '@stdlib/utils/define-property' );
24+
var setEnumerableReadOnly = require( '@stdlib/utils/define-read-only-property' );
2525
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
2626
var format = require( '@stdlib/string/format' );
2727
var toStr = require( './tostring.js' );
@@ -55,18 +55,8 @@ function Complex128( real, imag ) {
5555
if ( !isNumber( imag ) ) {
5656
throw new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) );
5757
}
58-
defineProperty( this, 're', {
59-
'configurable': false,
60-
'enumerable': true,
61-
'writable': false,
62-
'value': real
63-
});
64-
defineProperty( this, 'im', {
65-
'configurable': false,
66-
'enumerable': true,
67-
'writable': false,
68-
'value': imag
69-
});
58+
setEnumerableReadOnly( this, 're', real );
59+
setEnumerableReadOnly( this, 'im', imag );
7060
return this;
7161
}
7262

0 commit comments

Comments
 (0)