JSValue.makeSymbol constructor

JSValue.makeSymbol(
  1. JSContext context,
  2. String description, {
  3. bool autoDispose = true,
})

Creates a JavaScript value of the symbol type. description A description of the newly created symbol value.

Implementation

factory JSValue.makeSymbol(
  JSContext context,
  String description, {
  bool autoDispose = true,
}) {
  final jstring = JSString.fromString(description);
  return JSValue(
    context,
    JSValueMakeSymbol(context.ref, jstring.ref),
    autoDispose: autoDispose,
  );
}