Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Benchmark {
}

let title: String
let runner: JSFunctionRef = JSObjectRef.global.benchmarkRunner.function!
let runner = JSObject.global.benchmarkRunner.function!

func testSuite(_ name: String, _ body: @escaping () -> Void) {
let jsBody = JSClosure { arguments -> JSValue in
Expand Down
6 changes: 3 additions & 3 deletions 6 IntegrationTests/TestSuites/Sources/BenchmarkTests/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let serialization = Benchmark("Serialization")
let swiftInt: Double = 42
serialization.testSuite("Swift Int to JavaScript") {
let jsNumber = JSValue.number(swiftInt)
let object = JSObjectRef.global
let object = JSObject.global
for i in 0 ..< 100 {
object["numberValue\(i)"] = jsNumber
}
Expand All @@ -14,15 +14,15 @@ serialization.testSuite("Swift Int to JavaScript") {
let swiftString = "Hello, world"
serialization.testSuite("Swift String to JavaScript") {
let jsString = JSValue.string(swiftString)
let object = JSObjectRef.global
let object = JSObject.global
for i in 0 ..< 100 {
object["stringValue\(i)"] = jsString
}
}

let objectHeap = Benchmark("Object heap")

let global = JSObjectRef.global
let global = JSObject.global
let Object = global.Object.function!
global.objectHeapDummy = .object(Object.new())
objectHeap.testSuite("Increment and decrement RC") {
Expand Down
4 changes: 2 additions & 2 deletions 4 Sources/JavaScriptKit/BasicObjects/JSTypedArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ extension UInt32: TypedArrayElement {

// FIXME: Support passing BigInts across the bridge
//extension Int64: TypedArrayElement {
// public static var typedArrayClass: JSFunctionRef { JSObjectRef.global.BigInt64Array.function! }
// public static var typedArrayClass: JSFunction { JSObject.global.BigInt64Array.function! }
// public static var type: JavaScriptTypedArrayKind { .bigInt64 }
//}
//extension UInt64: TypedArrayElement {
// public static var typedArrayClass: JSFunctionRef { JSObjectRef.global.BigUint64Array.function! }
// public static var typedArrayClass: JSFunction { JSObject.global.BigUint64Array.function! }
// public static var type: JavaScriptTypedArrayKind { .bigUint64 }
//}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.