@@ -9,42 +9,31 @@ public class JSObjectRef: Equatable {
99
1010 @_disfavoredOverload
1111 public subscript( dynamicMember name: String ) -> ( ( JSValueConvertible . . . ) -> JSValue ) ? {
12- guard let function = self [ dynamicMember : name] . function else { return nil }
12+ guard let function = self [ name] . function else { return nil }
1313 return { ( arguments: JSValueConvertible... ) in
1414 function. apply ( this: self , argumentList: arguments)
1515 }
1616 }
1717
1818 public subscript( dynamicMember name: String ) -> JSValue {
19- get { get ( name) }
20- set { set ( name, newValue) }
19+ get { self [ name] }
20+ set { self [ name] = newValue }
2121 }
2222
23- public func get( _ name: String ) -> JSValue {
24- getJSValue ( this: self , name: name)
23+ public subscript( _ name: String ) -> JSValue {
24+ get { getJSValue ( this: self , name: name) }
25+ set { setJSValue ( this: self , name: name, value: newValue) }
2526 }
2627
27- public func set( _ name: String , _ value: JSValue ) {
28- setJSValue ( this: self , name: name, value: value)
29- }
30-
31- public func get( _ index: Int ) -> JSValue {
32- getJSValue ( this: self , index: Int32 ( index) )
28+ public subscript( _ index: Int ) -> JSValue {
29+ get { getJSValue ( this: self , index: Int32 ( index) ) }
30+ set { setJSValue ( this: self , index: Int32 ( index) , value: newValue) }
3331 }
3432
3533 public func instanceof( _ constructor: JSFunctionRef ) -> Bool {
3634 _instanceof ( self . id, constructor. id)
3735 }
3836
39- public subscript( _ index: Int ) -> JSValue {
40- get { get ( index) }
41- set { set ( index, newValue) }
42- }
43-
44- public func set( _ index: Int , _ value: JSValue ) {
45- setJSValue ( this: self , index: Int32 ( index) , value: value)
46- }
47-
4837 static let _JS_Predef_Value_Global : UInt32 = 0
4938 public static let global = JSObjectRef ( id: _JS_Predef_Value_Global)
5039
0 commit comments