jsNewContext function

Pointer<JSContext> jsNewContext(
  1. Pointer<JSRuntime> rt
)

Implementation

Pointer<JSContext> jsNewContext(Pointer<JSRuntime> rt) {
  final ctx = _jsNewContext(rt);
  if (ctx.address == 0) throw Exception('Context create failed!');
  final runtimeOpaque = runtimeOpaques[rt];
  if (runtimeOpaque == null) throw Exception('Runtime has been released!');
  runtimeOpaque._dartObjectClassId = jsNewClass(ctx, 'DartObject');
  return ctx;
}