From 939736ccf27df606b90ab36e5a33958364534dae Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 27 Aug 2012 10:41:08 -0400 Subject: [PATCH] Use more C stub pointers when possible. Update test_getter_time.js to output a value that can be interpreted as nanoseconds. --- src/rust-mozjs | 2 +- src/servo/dom/bindings/document.rs | 4 +++- src/test/test_getter_time.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rust-mozjs b/src/rust-mozjs index a89e0422f1e..194d39e0c4a 160000 --- a/src/rust-mozjs +++ b/src/rust-mozjs @@ -1 +1 @@ -Subproject commit a89e0422f1ee6953dfaa30e7b43995be664a7a29 +Subproject commit 194d39e0c4afd38705f0fafa212ea25bb6712201 diff --git a/src/servo/dom/bindings/document.rs b/src/servo/dom/bindings/document.rs index fd9dbfd829b..c4ba6f2584b 100644 --- a/src/servo/dom/bindings/document.rs +++ b/src/servo/dom/bindings/document.rs @@ -6,6 +6,7 @@ import js::jsapi::bindgen::{JS_ValueToString, JS_GetStringCharsZAndLength, JS_Re JS_GetReservedSlot, JS_SetReservedSlot, JS_NewStringCopyN, JS_DefineFunctions, JS_DefineProperty, JS_DefineProperties}; import js::glue::bindgen::*; +import js::glue::{PROPERTY_STUB, STRICT_PROPERTY_STUB}; import js::crust::{JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ConvertStub, JS_ResolveStub}; import result::{result, ok, err}; import ptr::null; @@ -114,6 +115,7 @@ fn init(compartment: bare_compartment, doc: @Document) { } compartment.define_property(~"document", RUST_OBJECT_TO_JSVAL(instance.ptr), - JS_PropertyStub, JS_StrictPropertyStub, + GetJSClassHookStubPointer(PROPERTY_STUB) as *u8, + GetJSClassHookStubPointer(STRICT_PROPERTY_STUB) as *u8, JSPROP_ENUMERATE); } diff --git a/src/test/test_getter_time.js b/src/test/test_getter_time.js index 495a5e2b2a7..cd901449b0d 100644 --- a/src/test/test_getter_time.js +++ b/src/test/test_getter_time.js @@ -1,7 +1,7 @@ var elem = document.documentElement.firstChild; var start = (new Date()).getTime(); -for (var i = 0; i < 100000; i++) { +for (var i = 0; i < 1000000; i++) { var a = elem.nodeType; } window.alert((new Date()).getTime() - start);