Changeset 166413 in webkit
- Timestamp:
- Mar 28, 2014 10:51:51 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/fast/dom/constants-expected.txt
r116039 r166413 28 28 PASS: nodeFilter.FILTER_REJECT should be 2 and is. 29 29 PASS: nodeFilter.FILTER_SKIP should be 3 and is. 30 PASS: nodeFilter.SHOW_ALL should be -1and is.30 PASS: nodeFilter.SHOW_ALL should be 4294967295 and is. 31 31 PASS: nodeFilter.SHOW_ELEMENT should be 1 and is. 32 32 PASS: nodeFilter.SHOW_ATTRIBUTE should be 2 and is. … … 44 44 PASS: window.NodeFilter.FILTER_REJECT should be 2 and is. 45 45 PASS: window.NodeFilter.FILTER_SKIP should be 3 and is. 46 PASS: window.NodeFilter.SHOW_ALL should be -1and is.46 PASS: window.NodeFilter.SHOW_ALL should be 4294967295 and is. 47 47 PASS: window.NodeFilter.SHOW_ELEMENT should be 1 and is. 48 48 PASS: window.NodeFilter.SHOW_ATTRIBUTE should be 2 and is. -
trunk/LayoutTests/fast/dom/constants.html
r120792 r166413 81 81 shouldBe("nodeFilter.FILTER_REJECT", 2); 82 82 shouldBe("nodeFilter.FILTER_SKIP", 3); 83 shouldBe("nodeFilter.SHOW_ALL", -1);83 shouldBe("nodeFilter.SHOW_ALL", 0xFFFFFFFF); 84 84 shouldBe("nodeFilter.SHOW_ELEMENT", 0x00000001); 85 85 shouldBe("nodeFilter.SHOW_ATTRIBUTE", 0x00000002); … … 98 98 shouldBe("window.NodeFilter.FILTER_REJECT", 2); 99 99 shouldBe("window.NodeFilter.FILTER_SKIP", 3); 100 shouldBe("window.NodeFilter.SHOW_ALL", -1);100 shouldBe("window.NodeFilter.SHOW_ALL", 0xFFFFFFFF); 101 101 shouldBe("window.NodeFilter.SHOW_ELEMENT", 0x00000001); 102 102 shouldBe("window.NodeFilter.SHOW_ATTRIBUTE", 0x00000002); -
trunk/Source/WebCore/ChangeLog
r166412 r166413 1 2014-03-26 Antonio Gomes <a1.gomes@sisa.samsung.com> 2 3 [Bindings] constants are always typed to 'int' 4 https://bugs.webkit.org/show_bug.cgi?id=130775 5 6 Reviewed by Darin Adler. 7 8 Patch fixes a bug where all constant getter generated 9 methods were returning 'integer' values due to static_cast. 10 11 Compilers should be smarth enough to properly infer which 12 jsNumber class construtor to call given a literal value. 13 14 Patch also fixes a bug where values whose representation 15 is bigger an integer maximum were overflowing. For instance, 16 NodeFilter.SHOW_ALL (0xFFFFFFFF). 17 18 Tests: 19 Binding tests updated. 20 Rebaselined fast/dom/constants.html 21 22 * bindings/scripts/CodeGeneratorJS.pm: 23 (GenerateImplementation): 24 * bindings/scripts/test/JS/JSTestInterface.cpp: 25 (WebCore::jsTestInterfaceIMPLEMENTSCONSTANT1): 26 (WebCore::jsTestInterfaceIMPLEMENTSCONSTANT2): 27 (WebCore::jsTestInterfaceSUPPLEMENTALCONSTANT1): 28 (WebCore::jsTestInterfaceSUPPLEMENTALCONSTANT2): 29 * bindings/scripts/test/JS/JSTestObj.cpp: 30 (WebCore::jsTestObjCONDITIONAL_CONST): 31 (WebCore::jsTestObjCONST_VALUE_0): 32 (WebCore::jsTestObjCONST_VALUE_1): 33 (WebCore::jsTestObjCONST_VALUE_2): 34 (WebCore::jsTestObjCONST_VALUE_4): 35 (WebCore::jsTestObjCONST_VALUE_8): 36 (WebCore::jsTestObjCONST_VALUE_9): 37 (WebCore::jsTestObjCONST_VALUE_11): 38 (WebCore::jsTestObjCONST_VALUE_12): 39 (WebCore::jsTestObjCONST_VALUE_13): 40 (WebCore::jsTestObjCONST_VALUE_14): 41 (WebCore::jsTestObjCONST_JAVASCRIPT): 42 (WebCore::jsTestObjReadonly): 43 1 44 2014-03-28 Myles C. Maxfield <mmaxfield@apple.com> 2 45 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r166411 r166413 2822 2822 } 2823 2823 2824 # FIXME: this casts into int to match our previous behavior which turned 0xFFFFFFFF in -1 for NodeFilter.SHOW_ALL2825 2824 push(@implContent, "EncodedJSValue ${getter}(ExecState* exec, JSObject*, EncodedJSValue, PropertyName)\n"); 2826 2825 push(@implContent, "{\n"); … … 2829 2828 } else { 2830 2829 push(@implContent, " UNUSED_PARAM(exec);\n"); 2831 push(@implContent, " return JSValue::encode(jsNumber( static_cast<int>(" . $constant->value . ")));\n");2830 push(@implContent, " return JSValue::encode(jsNumber(" . $constant->value . "));\n"); 2832 2831 } 2833 2832 push(@implContent, "}\n\n"); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r166128 r166413 933 933 { 934 934 UNUSED_PARAM(exec); 935 return JSValue::encode(jsNumber( static_cast<int>(1)));935 return JSValue::encode(jsNumber(1)); 936 936 } 937 937 … … 941 941 { 942 942 UNUSED_PARAM(exec); 943 return JSValue::encode(jsNumber( static_cast<int>(2)));943 return JSValue::encode(jsNumber(2)); 944 944 } 945 945 … … 949 949 { 950 950 UNUSED_PARAM(exec); 951 return JSValue::encode(jsNumber( static_cast<int>(1)));951 return JSValue::encode(jsNumber(1)); 952 952 } 953 953 … … 957 957 { 958 958 UNUSED_PARAM(exec); 959 return JSValue::encode(jsNumber( static_cast<int>(2)));959 return JSValue::encode(jsNumber(2)); 960 960 } 961 961 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r166128 r166413 4690 4690 { 4691 4691 UNUSED_PARAM(exec); 4692 return JSValue::encode(jsNumber( static_cast<int>(0)));4692 return JSValue::encode(jsNumber(0)); 4693 4693 } 4694 4694 … … 4697 4697 { 4698 4698 UNUSED_PARAM(exec); 4699 return JSValue::encode(jsNumber( static_cast<int>(0)));4699 return JSValue::encode(jsNumber(0)); 4700 4700 } 4701 4701 … … 4703 4703 { 4704 4704 UNUSED_PARAM(exec); 4705 return JSValue::encode(jsNumber( static_cast<int>(1)));4705 return JSValue::encode(jsNumber(1)); 4706 4706 } 4707 4707 … … 4709 4709 { 4710 4710 UNUSED_PARAM(exec); 4711 return JSValue::encode(jsNumber( static_cast<int>(2)));4711 return JSValue::encode(jsNumber(2)); 4712 4712 } 4713 4713 … … 4715 4715 { 4716 4716 UNUSED_PARAM(exec); 4717 return JSValue::encode(jsNumber( static_cast<int>(4)));4717 return JSValue::encode(jsNumber(4)); 4718 4718 } 4719 4719 … … 4721 4721 { 4722 4722 UNUSED_PARAM(exec); 4723 return JSValue::encode(jsNumber( static_cast<int>(8)));4723 return JSValue::encode(jsNumber(8)); 4724 4724 } 4725 4725 … … 4727 4727 { 4728 4728 UNUSED_PARAM(exec); 4729 return JSValue::encode(jsNumber( static_cast<int>(-1)));4729 return JSValue::encode(jsNumber(-1)); 4730 4730 } 4731 4731 … … 4738 4738 { 4739 4739 UNUSED_PARAM(exec); 4740 return JSValue::encode(jsNumber( static_cast<int>(0xffffffff)));4740 return JSValue::encode(jsNumber(0xffffffff)); 4741 4741 } 4742 4742 … … 4744 4744 { 4745 4745 UNUSED_PARAM(exec); 4746 return JSValue::encode(jsNumber( static_cast<int>(0x01)));4746 return JSValue::encode(jsNumber(0x01)); 4747 4747 } 4748 4748 … … 4750 4750 { 4751 4751 UNUSED_PARAM(exec); 4752 return JSValue::encode(jsNumber( static_cast<int>(0X20)));4752 return JSValue::encode(jsNumber(0X20)); 4753 4753 } 4754 4754 … … 4756 4756 { 4757 4757 UNUSED_PARAM(exec); 4758 return JSValue::encode(jsNumber( static_cast<int>(0x1abc)));4758 return JSValue::encode(jsNumber(0x1abc)); 4759 4759 } 4760 4760 … … 4762 4762 { 4763 4763 UNUSED_PARAM(exec); 4764 return JSValue::encode(jsNumber( static_cast<int>(15)));4764 return JSValue::encode(jsNumber(15)); 4765 4765 } 4766 4766 … … 4768 4768 { 4769 4769 UNUSED_PARAM(exec); 4770 return JSValue::encode(jsNumber( static_cast<int>(0)));4770 return JSValue::encode(jsNumber(0)); 4771 4771 } 4772 4772
Note: See TracChangeset
for help on using the changeset viewer.