CutBox.app

Coverage Report

Created: 2024-03-12 03:40

.../Source/Extensions/JSContext+subscript.swift
Line
Count
Source (jump to first uncovered line)
1
//
2
//  JSContext+subscript.swift
3
//  CutBox
4
//
5
//  Created by Jason Milkins on 12/5/18.
6
//  Copyright © 2018-2023 ocodo. All rights reserved.
7
//
8
9
import JavaScriptCore
10
11
extension JSContext {
12
67
    subscript(_ get: String) -> JSValue! {
13
67
        return self.objectForKeyedSubscript(get)
14
67
    }
15
16
    subscript(_ set: String) -> Any! {
17
82
        get { return nil } set {
18
82
            self.setObject(newValue, forKeyedSubscript: set as NSString)
19
82
        }
20
    }
21
}